projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
setjmp: optimize x86 longjmp epilogues
[musl]
/
src
/
stdio
/
flockfile.c
diff --git
a/src/stdio/flockfile.c
b/src/stdio/flockfile.c
index
a196c1e
..
8e22065
100644
(file)
--- a/
src/stdio/flockfile.c
+++ b/
src/stdio/flockfile.c
@@
-3,8
+3,7
@@
void flockfile(FILE *f)
{
- while (ftrylockfile(f)) {
- int owner = f->lock;
- if (owner) __wait(&f->lock, &f->waiters, owner, 1);
- }
+ if (!ftrylockfile(f)) return;
+ __lockfile(f);
+ __register_locked_file(f, __pthread_self());
}