]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #10479 : alexcrichton/rust/native-mutex.rs, r=cmr
authorbors <bors@rust-lang.org>
Tue, 19 Nov 2013 05:51:31 +0000 (21:51 -0800)
committerbors <bors@rust-lang.org>
Tue, 19 Nov 2013 05:51:31 +0000 (21:51 -0800)
This adds a new `std::unstable::mutex` module which contains bindings to the platform-provided mutexes. This module is pretty much entirely unsafe to use, but is critical for the runtime and dropping our C++ dependency.

The actual implementation is to do a compare-and-swap on an initially uninitialized pointer. Pthreads does allow for static initialization, so this wouldn't be necessary if we had all the proper headers and whatnot, but windows it looks like will always require some sort of compare-and-swap operation. For now, I didn't want to have to define all the pthreads headers, so I continue to just malloc the pthreads lock/cvar.

After this, there's only one remaining C++ component of rust, and that's unwinding.


Trivial merge