diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-12-29 15:03:01 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-01-01 22:02:59 -0800 |
| commit | f3a7ec7028c76b3a1c6051131328f372b068e33a (patch) | |
| tree | dce13e4152a6d9d988042c4be77720d14dcc62c0 /src/libstd/sys/windows | |
| parent | cd614164e692cca3a1460737f581fcb6d4630baf (diff) | |
| download | rust-f3a7ec7028c76b3a1c6051131328f372b068e33a.tar.gz rust-f3a7ec7028c76b3a1c6051131328f372b068e33a.zip | |
std: Second pass stabilization of sync
This pass performs a second pass of stabilization through the `std::sync`
module, avoiding modules/types that are being handled in other PRs (e.g.
mutexes, rwlocks, condvars, and channels).
The following items are now stable
* `sync::atomic`
* `sync::atomic::ATOMIC_BOOL_INIT` (was `INIT_ATOMIC_BOOL`)
* `sync::atomic::ATOMIC_INT_INIT` (was `INIT_ATOMIC_INT`)
* `sync::atomic::ATOMIC_UINT_INIT` (was `INIT_ATOMIC_UINT`)
* `sync::Once`
* `sync::ONCE_INIT`
* `sync::Once::call_once` (was `doit`)
* C == `pthread_once(..)`
* Boost == `call_once(..)`
* Windows == `InitOnceExecuteOnce`
* `sync::Barrier`
* `sync::Barrier::new`
* `sync::Barrier::wait` (now returns a `bool`)
* `sync::Semaphore::new`
* `sync::Semaphore::acquire`
* `sync::Semaphore::release`
The following items remain unstable
* `sync::SemaphoreGuard`
* `sync::Semaphore::access` - it's unclear how this relates to the poisoning
story of mutexes.
* `sync::TaskPool` - the semantics of a failing task and whether a thread is
re-attached to a thread pool are somewhat unclear, and the
utility of this type in `sync` is question with respect to
the jobs of other primitives. This type will likely become
stable or move out of the standard library over time.
* `sync::Future` - futures as-is have yet to be deeply re-evaluated with the
recent core changes to Rust's synchronization story, and will
likely become stable in the future but are unstable until
that time comes.
[breaking-change]
Diffstat (limited to 'src/libstd/sys/windows')
| -rw-r--r-- | src/libstd/sys/windows/mod.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/windows/mutex.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/sys/windows/mod.rs b/src/libstd/sys/windows/mod.rs index 57c284ed6a3..88313d66173 100644 --- a/src/libstd/sys/windows/mod.rs +++ b/src/libstd/sys/windows/mod.rs @@ -171,7 +171,7 @@ pub fn init_net() { unsafe { static START: Once = ONCE_INIT; - START.doit(|| { + START.call_once(|| { let mut data: c::WSADATA = mem::zeroed(); let ret = c::WSAStartup(0x202, // version 2.2 &mut data); diff --git a/src/libstd/sys/windows/mutex.rs b/src/libstd/sys/windows/mutex.rs index 3ac7c09154e..5f65b429d86 100644 --- a/src/libstd/sys/windows/mutex.rs +++ b/src/libstd/sys/windows/mutex.rs @@ -20,7 +20,7 @@ const SPIN_COUNT: DWORD = 4000; pub struct Mutex { inner: atomic::AtomicUint } -pub const MUTEX_INIT: Mutex = Mutex { inner: atomic::INIT_ATOMIC_UINT }; +pub const MUTEX_INIT: Mutex = Mutex { inner: atomic::ATOMIC_UINT_INIT }; unsafe impl Sync for Mutex {} |
