diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-04-07 13:30:48 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-04-08 00:03:11 -0700 |
| commit | c3ea3e439fbc5251279d914a95cd8344556982cb (patch) | |
| tree | c179b27b1d04dd7bfa17ab59b695c91fcd64320f /src/libstd/rt/thread.rs | |
| parent | c83afb9719ad6e2ae7d819b8096524e1147c4065 (diff) | |
| download | rust-c3ea3e439fbc5251279d914a95cd8344556982cb.tar.gz rust-c3ea3e439fbc5251279d914a95cd8344556982cb.zip | |
Register new snapshots
Diffstat (limited to 'src/libstd/rt/thread.rs')
| -rw-r--r-- | src/libstd/rt/thread.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libstd/rt/thread.rs b/src/libstd/rt/thread.rs index c35ffac064c..b1c7c5aab02 100644 --- a/src/libstd/rt/thread.rs +++ b/src/libstd/rt/thread.rs @@ -68,13 +68,13 @@ impl Thread<()> { /// to finish executing. This means that even if `join` is not explicitly /// called, when the `Thread` falls out of scope its destructor will block /// waiting for the OS thread. - pub fn start<T: Send>(main: proc:Send() -> T) -> Thread<T> { + pub fn start<T: Send>(main: proc():Send -> T) -> Thread<T> { Thread::start_stack(DEFAULT_STACK_SIZE, main) } /// Performs the same functionality as `start`, but specifies an explicit /// stack size for the new thread. - pub fn start_stack<T: Send>(stack: uint, main: proc:Send() -> T) -> Thread<T> { + pub fn start_stack<T: Send>(stack: uint, main: proc():Send -> T) -> Thread<T> { // We need the address of the packet to fill in to be stable so when // `main` fills it in it's still valid, so allocate an extra ~ box to do @@ -99,13 +99,13 @@ impl Thread<()> { /// This corresponds to creating threads in the 'detached' state on unix /// systems. Note that platforms may not keep the main program alive even if /// there are detached thread still running around. - pub fn spawn(main: proc:Send()) { + pub fn spawn(main: proc():Send) { Thread::spawn_stack(DEFAULT_STACK_SIZE, main) } /// Performs the same functionality as `spawn`, but explicitly specifies a /// stack size for the new thread. - pub fn spawn_stack(stack: uint, main: proc:Send()) { + pub fn spawn_stack(stack: uint, main: proc():Send) { unsafe { let handle = imp::create(stack, ~main); imp::detach(handle); @@ -156,7 +156,7 @@ mod imp { pub type rust_thread = HANDLE; pub type rust_thread_return = DWORD; - pub unsafe fn create(stack: uint, p: ~proc:Send()) -> rust_thread { + pub unsafe fn create(stack: uint, p: ~proc():Send) -> rust_thread { let arg: *mut libc::c_void = cast::transmute(p); // FIXME On UNIX, we guard against stack sizes that are too small but // that's because pthreads enforces that stacks are at least @@ -215,7 +215,7 @@ mod imp { pub type rust_thread = libc::pthread_t; pub type rust_thread_return = *u8; - pub unsafe fn create(stack: uint, p: ~proc:Send()) -> rust_thread { + pub unsafe fn create(stack: uint, p: ~proc():Send) -> rust_thread { let mut native: libc::pthread_t = mem::uninit(); let mut attr: libc::pthread_attr_t = mem::uninit(); assert_eq!(pthread_attr_init(&mut attr), 0); |
