Correctly handle the race itself, too (don't leave it locked).

This is about to be replaced anyway by initialization explicitly
instead of lazily, and reducing the complexity of it.  As it is
now, this will work fine, however.
This commit is contained in:
Brian Feldman
2001-02-23 17:55:01 +00:00
parent bfa7e882d1
commit 75d4fd11cb
+1
View File
@@ -99,6 +99,7 @@ init_lock(FILE *fp)
}
if (fp->_lock != NULL) { /* lost the race */
free(p);
_pthread_mutex_unlock(&init_lock_mutex);
return (0);
}
fp->_lock = p;