clean up handling of thread/nothread mode, locking

This commit is contained in:
Rich Felker
2011-04-17 16:53:54 -04:00
parent eb0e8fa0b1
commit 9080cc153c
8 changed files with 16 additions and 27 deletions

View File

@ -3,9 +3,6 @@
void flockfile(FILE *f)
{
if (!libc.lockfile) {
pthread_self();
libc.lockfile = __lockfile;
}
if (!libc.threaded) pthread_self();
__lockfile(f);
}

View File

@ -4,7 +4,6 @@
int ftrylockfile(FILE *f)
{
int tid = pthread_self()->tid;
if (!libc.lockfile) libc.lockfile = __lockfile;
if (f->lock == tid) {
if (f->lockcount == INT_MAX)
return -1;