[haiku-commits] r33681 - haiku/trunk/src/system/libroot/os

Author: mmlr
Date: 2009-10-20 21:05:35 +0200 (Tue, 20 Oct 2009)
New Revision: 33681
Changeset: http://dev.haiku-os.org/changeset/33681/haiku

Modified:
   haiku/trunk/src/system/libroot/os/locks.cpp
Log:
Add small but very important missing detail. Before blocking it didn't set the
wait status and therefore would return directly without actually blocking.


Modified: haiku/trunk/src/system/libroot/os/locks.cpp
===================================================================
--- haiku/trunk/src/system/libroot/os/locks.cpp 2009-10-20 15:20:46 UTC (rev 
33680)
+++ haiku/trunk/src/system/libroot/os/locks.cpp 2009-10-20 19:05:35 UTC (rev 
33681)
@@ -5,6 +5,7 @@
 
 #include <locks.h>
 #include <syscalls.h>
+#include <user_thread.h>
 
 #include <OS.h>
 
@@ -77,6 +78,7 @@
        lock->last_waiter = &waiter;
 
        // the rw_lock is locked when entering, release it before blocking
+       get_user_thread()->wait_status = 1;
        mutex_unlock(&lock->lock);
 
        status_t result;


Other related posts:

  • » [haiku-commits] r33681 - haiku/trunk/src/system/libroot/os - mmlr