]> git.lizzy.rs Git - rust.git/commit
std: Audit std::thread implementations
authorAlex Crichton <alex@alexcrichton.com>
Wed, 15 Apr 2015 05:13:57 +0000 (22:13 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Wed, 22 Apr 2015 17:42:33 +0000 (10:42 -0700)
commit2e1100997863c4951371cf39554c53266cacb37d
treee4d266578d80fa55705ba349c4508191fd5a692b
parente9e9279d87d5786fcb8e12482f2920979602267b
std: Audit std::thread implementations

Much of this code hasn't been updated in quite some time and this commit does a
small audit of the functionality:

* Implementation functions now centralize all functionality on a locally defined
  `Thread` type.
* The `detach` method has been removed in favor of a `Drop` implementation. This
  notably fixes leaking thread handles on Windows.
* The `Thread` structure is now appropriately annotated with `Send` and `Sync`
  automatically on Windows and in a custom fashion on Unix.
* The unsafety of creating a thread has been pushed out to the right boundaries
  now.

Closes #24442
src/libstd/sys/common/thread.rs
src/libstd/sys/unix/thread.rs
src/libstd/sys/windows/c.rs
src/libstd/sys/windows/thread.rs
src/libstd/thread/mod.rs