]> git.lizzy.rs Git - rust.git/commit
Audit usage of NativeMutex
authorAlex Crichton <alex@alexcrichton.com>
Thu, 12 Jun 2014 18:40:13 +0000 (11:40 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Fri, 13 Jun 2014 20:53:34 +0000 (13:53 -0700)
commitac7b9ddc545b7f62f00bf8f4d490d31ff4b90d1d
tree88392ca6e57d1ec5481f9cc9d002b7b153bd8148
parentb612ae9edea26cb8704363c47a66d583b644ad09
Audit usage of NativeMutex

Once a native mutex has been used once, it is never allowed to be moved again.
This is because some pthreads implementations take pointers inside the mutex
itself.

This commit adds stern wording around the methods on native mutexes, and fixes
one use case in the codebase. The Mutex type in libsync was susceptible to
movement, so the inner static mutex is now boxed to ensure that the address of
the native mutex is constant.
src/librustrt/mutex.rs
src/librustrt/unwind.rs
src/libsync/mutex.rs