projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix Makefile so "make install" works before include/bits symlink exists
[musl]
/
src
/
stdio
/
flockfile.c
diff --git
a/src/stdio/flockfile.c
b/src/stdio/flockfile.c
index
0d4c92c
..
a196c1e
100644
(file)
--- a/
src/stdio/flockfile.c
+++ b/
src/stdio/flockfile.c
@@
-3,6
+3,8
@@
void flockfile(FILE *f)
{
void flockfile(FILE *f)
{
- if (!libc.threaded) pthread_self();
- __lockfile(f);
+ while (ftrylockfile(f)) {
+ int owner = f->lock;
+ if (owner) __wait(&f->lock, &f->waiters, owner, 1);
+ }
}
}