From 4d9cc0b399b1d6a146cb45e64c74b7ee562de7a6 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 16 Mar 2011 10:39:45 -0400 Subject: optimize file locking: avoid cache-polluting writes to global storage --- src/stdio/ftrylockfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/stdio/ftrylockfile.c') diff --git a/src/stdio/ftrylockfile.c b/src/stdio/ftrylockfile.c index 725b66e7..1d0a1ff8 100644 --- a/src/stdio/ftrylockfile.c +++ b/src/stdio/ftrylockfile.c @@ -3,7 +3,7 @@ int ftrylockfile(FILE *f) { - libc.lockfile = __lockfile; + if (!libc.lockfile) libc.lockfile = __lockfile; if (f->owner && f->owner == pthread_self()->tid) { if (f->lockcount == INT_MAX) return -1; -- cgit v1.2.1