about summary refs log tree commit diff
path: root/src/libstd/sys/windows/thread.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-11-02 16:23:22 -0800
committerAlex Crichton <alex@alexcrichton.com>2015-11-09 22:55:50 -0800
commit3d28b8b98e6e4f55ef4ecd8babf0a050f48a3d11 (patch)
tree343087c9e62da65e2780db851682280697064c5b /src/libstd/sys/windows/thread.rs
parentc8a29c2092cec369a751051a2bfed093522ff6e8 (diff)
downloadrust-3d28b8b98e6e4f55ef4ecd8babf0a050f48a3d11.tar.gz
rust-3d28b8b98e6e4f55ef4ecd8babf0a050f48a3d11.zip
std: Migrate to the new libc
* Delete `sys::unix::{c, sync}` as these are now all folded into libc itself
* Update all references to use `libc` as a result.
* Update all references to the new flat namespace.
* Moves all windows bindings into sys::c
Diffstat (limited to 'src/libstd/sys/windows/thread.rs')
-rw-r--r--src/libstd/sys/windows/thread.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/libstd/sys/windows/thread.rs b/src/libstd/sys/windows/thread.rs
index cf1b3ebddb9..a6e6cc94b76 100644
--- a/src/libstd/sys/windows/thread.rs
+++ b/src/libstd/sys/windows/thread.rs
@@ -12,8 +12,8 @@ use prelude::v1::*;
 
 use alloc::boxed::FnBox;
 use io;
-use libc::{self, c_void, DWORD};
 use mem;
+use libc::c_void;
 use ptr;
 use sys::c;
 use sys::handle::Handle;
@@ -37,7 +37,7 @@ impl Thread {
         // Round up to the next 64 kB because that's what the NT kernel does,
         // might as well make it explicit.
         let stack_size = (stack + 0xfffe) & (!0xfffe);
-        let ret = c::CreateThread(ptr::null_mut(), stack_size as libc::size_t,
+        let ret = c::CreateThread(ptr::null_mut(), stack_size,
                                   thread_start, &*p as *const _ as *mut _,
                                   0, ptr::null_mut());
 
@@ -48,7 +48,7 @@ impl Thread {
             Ok(Thread { handle: Handle::new(ret) })
         };
 
-        extern "system" fn thread_start(main: *mut libc::c_void) -> DWORD {
+        extern "system" fn thread_start(main: *mut c_void) -> c::DWORD {
             unsafe { start_thread(main); }
             0
         }
@@ -62,8 +62,7 @@ impl Thread {
     }
 
     pub fn join(self) {
-        use libc::consts::os::extra::INFINITE;
-        unsafe { c::WaitForSingleObject(self.handle.raw(), INFINITE); }
+        unsafe { c::WaitForSingleObject(self.handle.raw(), c::INFINITE); }
     }
 
     pub fn yield_now() {