Created
January 30, 2014 13:23
-
-
Save pzol/8708193 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::sync::atomics::{ AtomicUint, INIT_ATOMIC_UINT, Ordering, AcqRel }; | |
static counter: AtomicUint = INIT_ATOMIC_UINT; | |
fn call() -> uint { | |
let current = counter.fetch_add(1, AcqRel); | |
current.clone() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
/Users/pzol/Dropbox/src/rust/one/src/varnish/test.rs:6:17: 6:24 error: cannot borrow immutable static item as mutable
/Users/pzol/Dropbox/src/rust/one/src/varnish/test.rs:6 let current = counter.fetch_add(1, AcqRel);
^~~~~~~
error: aborting due to previous error