[vmkit-commits] [vmkit] r180329 - Extended RecursiveLock class to allow unlocking a lock by a thread that

Peter Senna Tschudin peter.senna at gmail.com
Thu Apr 25 09:57:10 PDT 2013


Author: peter.senna
Date: Thu Apr 25 11:55:40 2013
New Revision: 180329

URL: http://llvm.org/viewvc/llvm-project?rev=180329&view=rev
Log:
Extended RecursiveLock class to allow unlocking a lock by a thread that
does not own it.(cherry picked from commit 4c93deb096a677b8101a7745ba54e9982da4c3a2)

Modified:
    vmkit/trunk/include/vmkit/Locks.h
    vmkit/trunk/lib/vmkit/CommonThread/ctlock.cpp

Modified: vmkit/trunk/include/vmkit/Locks.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/vmkit/Locks.h?rev=180329&r1=180328&r2=180329&view=diff
==============================================================================
--- vmkit/trunk/include/vmkit/Locks.h (original)
+++ vmkit/trunk/include/vmkit/Locks.h Thu Apr 25 11:55:40 2013
@@ -131,7 +131,7 @@ public:
   /// unlockAll - Unlock the lock, releasing it the number of times it is held.
   /// Return the number of times the lock has been locked.
   ///
-  int unlockAll();
+  int unlockAll(vmkit::Thread* ownerThread = NULL);
 
   /// lockAll - Acquire the lock count times.
   ///

Modified: vmkit/trunk/lib/vmkit/CommonThread/ctlock.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/vmkit/CommonThread/ctlock.cpp?rev=180329&r1=180328&r2=180329&view=diff
==============================================================================
--- vmkit/trunk/lib/vmkit/CommonThread/ctlock.cpp (original)
+++ vmkit/trunk/lib/vmkit/CommonThread/ctlock.cpp Thu Apr 25 11:55:40 2013
@@ -108,8 +108,8 @@ void LockRecursive::unlock(vmkit::Thread
   }
 }
 
-int LockRecursive::unlockAll() {
-  assert(selfOwner() && "Not owner when unlocking all");
+int LockRecursive::unlockAll(vmkit::Thread* ownerThread) {
+  assert(selfOwner(ownerThread) && "Not owner when unlocking all");
   int res = n;
   n = 0;
   owner = 0;





More information about the vmkit-commits mailing list