OLD | NEW |
---|---|
1 #include "stdio_impl.h" | 1 #include "stdio_impl.h" |
2 #include "pthread_impl.h" | 2 #include "pthread_impl.h" |
3 | 3 |
4 void flockfile(FILE *f) | 4 void flockfile(FILE* f) { |
5 { | 5 while (ftrylockfile(f)) { |
6 » while (ftrylockfile(f)) { | 6 int owner = f->lock; |
7 » » int owner = f->lock; | 7 if (owner) |
8 » » if (owner) __wait(&f->lock, &f->waiters, owner, 1); | 8 __wait(&f->lock, &f->waiters, owner, 1); |
9 » } | 9 } |
10 } | 10 } |
OLD | NEW |