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

@ -8,7 +8,7 @@ pid_t fork(void)
pid_t ret;
if (libc.fork_handler) libc.fork_handler(-1);
ret = syscall(SYS_fork);
if (libc.lock && !ret) {
if (libc.threaded && !ret) {
pthread_t self = __pthread_self();
self->tid = self->pid = syscall(SYS_getpid);
libc.threads_minus_1 = 0;