Skip to content

Commit 009ec5d

Browse files
committed
rollup merge of #20315: alexcrichton/std-sync
Conflicts: src/libstd/rt/exclusive.rs src/libstd/sync/barrier.rs src/libstd/sys/unix/pipe.rs src/test/bench/shootout-binarytrees.rs src/test/bench/shootout-fannkuch-redux.rs
2 parents 0101bbe + f3a7ec7 commit 009ec5d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+167
-792
lines changed

src/doc/guide-tasks.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ getting the result later.
206206
The basic example below illustrates this.
207207

208208
```{rust,ignore}
209+
# #![allow(deprecated)]
209210
use std::sync::Future;
210211
211212
# fn main() {
@@ -233,6 +234,7 @@ Here is another example showing how futures allow you to background
233234
computations. The workload will be distributed on the available cores.
234235

235236
```{rust,ignore}
237+
# #![allow(deprecated)]
236238
# use std::num::Float;
237239
# use std::sync::Future;
238240
fn partial_sum(start: uint) -> f64 {

src/doc/guide.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5339,6 +5339,7 @@ example, if you wish to compute some value in the background, `Future` is
53395339
a useful thing to use:
53405340
53415341
```{rust}
5342+
# #![allow(deprecated)]
53425343
use std::sync::Future;
53435344
53445345
let mut delayed_value = Future::spawn(move || {

src/doc/reference.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1480,9 +1480,9 @@ data are being stored, or single-address and mutability properties are required.
14801480
```
14811481
use std::sync::atomic;
14821482
1483-
// Note that INIT_ATOMIC_UINT is a *const*, but it may be used to initialize a
1483+
// Note that ATOMIC_UINT_INIT is a *const*, but it may be used to initialize a
14841484
// static. This static can be modified, so it is not placed in read-only memory.
1485-
static COUNTER: atomic::AtomicUint = atomic::INIT_ATOMIC_UINT;
1485+
static COUNTER: atomic::AtomicUint = atomic::ATOMIC_UINT_INIT;
14861486
14871487
// This table is a candidate to be placed in read-only memory.
14881488
static TABLE: &'static [uint] = &[1, 2, 3, /* ... */];

src/libcollections/vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2265,7 +2265,7 @@ mod tests {
22652265
}
22662266
}
22672267
const NUM_ELEMENTS: uint = 2;
2268-
static DROP_COUNTER: AtomicUint = atomic::INIT_ATOMIC_UINT;
2268+
static DROP_COUNTER: AtomicUint = atomic::ATOMIC_UINT_INIT;
22692269

22702270
let v = Vec::from_elem(NUM_ELEMENTS, Nothing);
22712271

src/libcore/atomic.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,27 @@ pub enum Ordering {
8989

9090
/// An `AtomicBool` initialized to `false`.
9191
#[unstable = "may be renamed, pending conventions for static initalizers"]
92-
pub const INIT_ATOMIC_BOOL: AtomicBool =
92+
pub const ATOMIC_BOOL_INIT: AtomicBool =
9393
AtomicBool { v: UnsafeCell { value: 0 } };
9494
/// An `AtomicInt` initialized to `0`.
9595
#[unstable = "may be renamed, pending conventions for static initalizers"]
96-
pub const INIT_ATOMIC_INT: AtomicInt =
96+
pub const ATOMIC_INT_INIT: AtomicInt =
9797
AtomicInt { v: UnsafeCell { value: 0 } };
9898
/// An `AtomicUint` initialized to `0`.
9999
#[unstable = "may be renamed, pending conventions for static initalizers"]
100-
pub const INIT_ATOMIC_UINT: AtomicUint =
100+
pub const ATOMIC_UINT_INIT: AtomicUint =
101101
AtomicUint { v: UnsafeCell { value: 0, } };
102102

103+
/// Deprecated
104+
#[deprecated = "renamed to ATOMIC_BOOL_INIT"]
105+
pub const INIT_ATOMIC_BOOL: AtomicBool = ATOMIC_BOOL_INIT;
106+
/// Deprecated
107+
#[deprecated = "renamed to ATOMIC_INT_INIT"]
108+
pub const INIT_ATOMIC_INT: AtomicInt = ATOMIC_INT_INIT;
109+
/// Deprecated
110+
#[deprecated = "renamed to ATOMIC_UINT_INIT"]
111+
pub const INIT_ATOMIC_UINT: AtomicUint = ATOMIC_UINT_INIT;
112+
103113
// NB: Needs to be -1 (0b11111111...) to make fetch_nand work correctly
104114
const UINT_TRUE: uint = -1;
105115

src/libcore/cell.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@
155155
// FIXME: Can't be shared between threads. Dynamic borrows
156156
// FIXME: Relationship to Atomic types and RWLock
157157

158+
#![stable]
159+
158160
use clone::Clone;
159161
use cmp::PartialEq;
160162
use default::Default;

src/libcoretest/atomic.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ fn int_xor() {
7070
assert_eq!(x.load(SeqCst), 0xf731 ^ 0x137f);
7171
}
7272

73-
static S_BOOL : AtomicBool = INIT_ATOMIC_BOOL;
74-
static S_INT : AtomicInt = INIT_ATOMIC_INT;
75-
static S_UINT : AtomicUint = INIT_ATOMIC_UINT;
73+
static S_BOOL : AtomicBool = ATOMIC_BOOL_INIT;
74+
static S_INT : AtomicInt = ATOMIC_INT_INIT;
75+
static S_UINT : AtomicUint = ATOMIC_UINT_INIT;
7676

7777
#[test]
7878
fn static_init() {

src/liblog/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ pub struct LogLocation {
352352
#[doc(hidden)]
353353
pub fn mod_enabled(level: u32, module: &str) -> bool {
354354
static INIT: Once = ONCE_INIT;
355-
INIT.doit(init);
355+
INIT.call_once(init);
356356

357357
// It's possible for many threads are in this function, only one of them
358358
// will perform the global initialization, but all of them will need to check

src/librustc/middle/infer/region_inference/graphviz.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ pub fn maybe_print_constraints_for<'a, 'tcx>(region_vars: &RegionVarBindings<'a,
7373
let output_path = {
7474
let output_template = match requested_output {
7575
Some(ref s) if s.as_slice() == "help" => {
76-
static PRINTED_YET : atomic::AtomicBool = atomic::INIT_ATOMIC_BOOL;
76+
static PRINTED_YET : atomic::AtomicBool = atomic::ATOMIC_BOOL_INIT;
7777
if !PRINTED_YET.load(atomic::SeqCst) {
7878
print_help_message();
7979
PRINTED_YET.store(true, atomic::SeqCst);

src/librustc_trans/back/write.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,7 @@ unsafe fn configure_llvm(sess: &Session) {
10111011
}
10121012
}
10131013

1014-
INIT.doit(|| {
1014+
INIT.call_once(|| {
10151015
llvm::LLVMInitializePasses();
10161016

10171017
// Only initialize the platforms supported by Rust here, because

0 commit comments

Comments
 (0)