Logo
Explore Help
Register Sign In
caio/clang-p2996
1
0
Fork 0
You've already forked clang-p2996
Code Issues Pull Requests Actions Packages Projects Releases Wiki Activity
Files
80bec83d8db7ea6c35f2c2cfdfd619ebd290e4e4
clang-p2996/libcxx/test/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons
History
David Chisnall 8b6a4de64a 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
2013-02-19 11:28:45 +00:00
..
copy_assign.fail.cpp
…
copy_ctor.fail.cpp
…
default.pass.cpp
…
move_assign.pass.cpp
…
move_ctor.pass.cpp
…
mutex_adopt_lock.pass.cpp
…
mutex_defer_lock.pass.cpp
…
mutex_duration.pass.cpp
…
mutex_time_point.pass.cpp
…
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.
2013-02-19 11:28:45 +00:00
mutex.pass.cpp
…
Powered by Gitea Version: 1.25.1 Page: 1030ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API