You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libcxx/test/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons
David Chisnall 76aa2ef017 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.



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@175506 91177308-0d34-0410-b5e6-96231b3b80d8
13 years ago
..
copy_assign.fail.cpp license change 15 years ago
copy_ctor.fail.cpp license change 15 years ago
default.pass.cpp license change 15 years ago
move_assign.pass.cpp license change 15 years ago
move_ctor.pass.cpp license change 15 years ago
mutex.pass.cpp [tests] Increase a bunch of wait limits. 13 years ago
mutex_adopt_lock.pass.cpp license change 15 years ago
mutex_defer_lock.pass.cpp license change 15 years ago
mutex_duration.pass.cpp Give a lot more timing latitude to some of the timing tests. Busy buildbots are hitting the timing limits too often. 13 years ago
mutex_time_point.pass.cpp [tests] Increase a bunch of wait limits. 13 years ago
mutex_try_to_lock.pass.cpp 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. 13 years ago