1 #include "stdio_impl.h"
2 #include "pthread_impl.h"
4 int ftrylockfile(FILE *f)
6 if (!libc.lockfile) libc.lockfile = __lockfile;
7 if (f->owner && f->owner == pthread_self()->tid) {
8 if (f->lockcount == INT_MAX)
13 if (a_swap(&f->lock, 1))
15 f->owner = pthread_self()->tid;