Skip to content
Commit 8b6a4de6 authored by David Chisnall's avatar David Chisnall
Browse files

Fix a bug in mutex_try_to_lock. This was previously trying to unlock a mutex...

Fix a bug in mutex_try_to_lock.  This was previously trying to unlock a mutex that it didn't own, causing an assertion failure in mutex.cpp.  The issue was that the unique_lock went out of scope, releasing the lock on m, then m.unlock() was called on an already-unlocked mutex.  

This change removes the spurious m.unlock() call.  

If this test was previously passing for anyone with assertions enabled, then they should investigate bugs in their pthread implementation, as pthread_unlock() should not return 0 if the mutex is currently unlocked.

llvm-svn: 175506
parent d26b3334
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment