diff options
| author | bors <bors@rust-lang.org> | 2015-11-10 06:56:30 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-11-10 06:56:30 +0000 |
| commit | 6aee7c5d2c3e5796844671cf072487f6fb04cb9b (patch) | |
| tree | 955886bbc19c1ce0943377edf689ad4dd1842749 /src/libstd/sys/windows/thread.rs | |
| parent | 2968dfa28597e50b748b641f9b881c7012b041c6 (diff) | |
| parent | 3d28b8b98e6e4f55ef4ecd8babf0a050f48a3d11 (diff) | |
| download | rust-6aee7c5d2c3e5796844671cf072487f6fb04cb9b.tar.gz rust-6aee7c5d2c3e5796844671cf072487f6fb04cb9b.zip | |
Auto merge of #29546 - alexcrichton:new-libc, r=brson
This commit replaces the in-tree liblibc with the [external clone](https://github.com/rust-lang-nursery/libc) which has no evolved beyond the in-tree version in light of its [recent redesign](https://github.com/rust-lang/rfcs/pull/1291).
The primary changes here are:
* `src/liblibc/lib.rs` was deleted
* `src/liblibc` is now a submodule pointing at the external repository
* `src/libstd/sys/unix/{c.rs,sync.rs}` were both deleted having all bindings folded into the external liblibc.
* Many ad-hoc `extern` blocks in the standard library were removed in favor of bindings now being in the external liblibc.
* Many functions/types were added to `src/libstd/sys/windows/c.rs`, and the scattered definitions throughout the standard library were consolidated here.
At the API level this commit is **not a breaking change**, although it is only very lightly tested on the *BSD variants and is probably going to break almost all of their builds! Follow-up commits to liblibc should in theory be all that's necessary to get the build working on the *BSDs again.
Diffstat (limited to 'src/libstd/sys/windows/thread.rs')
| -rw-r--r-- | src/libstd/sys/windows/thread.rs | 9 |
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() { |
