]> git.lizzy.rs Git - rust.git/commit
Fix undefined behavior when re-locking a mutex from the same thread
authorAmanieu d'Antras <amanieu@gmail.com>
Wed, 25 May 2016 04:44:28 +0000 (05:44 +0100)
committerAmanieu d'Antras <amanieu@gmail.com>
Thu, 2 Jun 2016 12:31:01 +0000 (13:31 +0100)
commitd73f5e65ecbcb6a0acb908b54226edfccf47eccc
treeb65444fe5785dbd66b4e04ff14c2575ad475407b
parenteea4f0c24893d3b5bffec067e6051eb0b5106748
Fix undefined behavior when re-locking a mutex from the same thread

The only applies to pthread mutexes. We solve this by creating the
mutex with the PTHREAD_MUTEX_NORMAL type, which guarantees that
re-locking from the same thread will deadlock.
src/libstd/sync/mutex.rs
src/libstd/sys/common/mutex.rs
src/libstd/sys/unix/mutex.rs
src/libstd/sys/windows/mutex.rs