1
Fork 0

Make it possible to have unboxed mutexes on specific platforms.

This commit keeps all mutexes boxed on all platforms, but makes it
trivial to remove the box on some platforms later.
This commit is contained in:
Mara Bos 2020-10-01 01:06:35 +02:00
parent a8c2d4fc3d
commit 58deb7001d
10 changed files with 51 additions and 9 deletions

View file

@ -5,6 +5,8 @@ pub struct Mutex {
inner: UnsafeCell<libc::pthread_mutex_t>,
}
pub type MovableMutex = Box<Mutex>;
#[inline]
pub unsafe fn raw(m: &Mutex) -> *mut libc::pthread_mutex_t {
m.inner.get()