]> git.saurik.com Git - apple/libpthread.git/blobdiff - kern/kern_synch.c
libpthread-137.1.1.tar.gz
[apple/libpthread.git] / kern / kern_synch.c
index ca75f6fd678a04c4bb4aa992be531b6bc6466b19..713691265dae1c17459d519ed9e31e9edcb54922 100644 (file)
@@ -68,7 +68,6 @@
 #include <kern/zalloc.h>
 #include <kern/sched_prim.h>
 #include <kern/processor.h>
-#include <kern/wait_queue.h>
 //#include <kern/mach_param.h>
 #include <mach/mach_vm.h>
 #include <mach/mach_param.h>
@@ -1609,6 +1608,7 @@ ksyn_wqfind(user_addr_t uaddr, uint32_t mgen, uint32_t ugen, uint32_t sgen, int
                pthread_list_lock();
                res = ksyn_wq_hash_lookup(uaddr, current_proc(), flags, &kwq, &hashptr, &object, &offset);
                if (res != 0) {
+                       pthread_list_unlock();
                        break;
                }
                if (kwq == NULL && nkwq == NULL) {
@@ -1679,9 +1679,9 @@ ksyn_wqfind(user_addr_t uaddr, uint32_t mgen, uint32_t ugen, uint32_t sgen, int
                                kwq->kw_dropcount++;
                        }
                }
+               pthread_list_unlock();
                break;
        }
-       pthread_list_unlock();
        if (kwqp != NULL) {
                *kwqp = kwq;
        }