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:
green 2001-02-23 17:55:01 +00:00
parent 575ee59b1c
commit 77bc7b795e

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;