about summary refs log tree commit diff
path: root/src/libstd/sys/common/thread_local.rs
AgeCommit message (Collapse)AuthorLines
2015-08-15std: Add issues to all unstable featuresAlex Crichton-1/+1
2015-08-11Register new snapshotsAlex Crichton-3/+0
* Lots of core prelude imports removed * Makefile support for MSVC env vars and Rust crates removed * Makefile support for morestack removed
2015-08-03syntax: Implement #![no_core]Alex Crichton-0/+1
This commit is an implementation of [RFC 1184][rfc] which tweaks the behavior of the `#![no_std]` attribute and adds a new `#![no_core]` attribute. The `#![no_std]` attribute now injects `extern crate core` at the top of the crate as well as the libcore prelude into all modules (in the same manner as the standard library's prelude). The `#![no_core]` attribute disables both std and core injection. [rfc]: https://github.com/rust-lang/rfcs/pull/1184
2015-06-09Exise 'unsafe pointer' in favor of 'raw pointer'Steve Klabnik-1/+1
Using two terms for one thing is confusing, these are called 'raw pointers' today.
2015-05-27Use `const fn` to abstract away the contents of UnsafeCell & friends.Eduard Burtescu-26/+17
2015-04-13pluralize doc comment verbs and add missing periodsAndrew Paseltiner-1/+1
2015-03-26Mass rename uint/int to usize/isizeAlex Crichton-7/+7
Now that support has been removed, all lingering use cases are renamed.
2015-03-20Revert "Revert "std: Re-enable at_exit()""Alex Crichton-4/+0
This reverts commit aec67c2ee0f673ea7b0e21c2fe7e0f26a523d823.
2015-03-12std: Remove #[allow] directives in sys modulesAlex Crichton-0/+1
These were suppressing lots of interesting warnings! Turns out there was also quite a bit of dead code.
2015-03-11Example -> ExamplesSteve Klabnik-3/+3
This brings comments in line with https://github.com/rust-lang/rfcs/blob/master/text/0505-api-comment-conventions.md#using-markdown
2015-03-06Use `#[allow_internal_unstable]` for `thread_local!`Huon Wilson-5/+1
This destabilises all the implementation details of `thread_local!`, since they do not *need* to be stable with the new attribute.
2015-02-17Fallout from stabilizationAaron Turon-1/+1
2015-02-11More test fixes and rebase conflictsAlex Crichton-0/+1
2015-02-11Test fixes and rebase conflictsAlex Crichton-0/+4
2015-01-11Rename AtomicInt and AtomicUintSteven Fackler-3/+3
Change any use of AtomicInt to AtomicIsize and AtomicUint to AtomicUsize Closes #20893 [breaking-change]
2015-01-03Remove deprecated functionalityAlex Crichton-4/+4
This removes a large array of deprecated functionality, regardless of how recently it was deprecated. The purpose of this commit is to clean out the standard libraries and compiler for the upcoming alpha release. Some notable compiler changes were to enable warnings for all now-deprecated command line arguments (previously the deprecated versions were silently accepted) as well as removing deriving(Zero) entirely (the trait was removed). The distribution no longer contains the libtime or libregex_macros crates. Both of these have been deprecated for some time and are available externally.
2015-01-03sed -i -s 's/\bmod,/self,/g' **/*.rsJorge Aparicio-1/+1
2015-01-02rollup merge of #20315: alexcrichton/std-syncAlex Crichton-1/+1
Conflicts: src/libstd/rt/exclusive.rs src/libstd/sync/barrier.rs src/libstd/sys/unix/pipe.rs src/test/bench/shootout-binarytrees.rs src/test/bench/shootout-fannkuch-redux.rs
2015-01-02std: Stabilize the prelude moduleAlex Crichton-2/+2
This commit is an implementation of [RFC 503][rfc] which is a stabilization story for the prelude. Most of the RFC was directly applied, removing reexports. Some reexports are kept around, however: * `range` remains until range syntax has landed to reduce churn. * `Path` and `GenericPath` remain until path reform lands. This is done to prevent many imports of `GenericPath` which will soon be removed. * All `io` traits remain until I/O reform lands so imports can be rewritten all at once to `std::io::prelude::*`. This is a breaking change because many prelude reexports have been removed, and the RFC can be consulted for the exact list of removed reexports, as well as to find the locations of where to import them. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0503-prelude-stabilization.md [breaking-change] Closes #20068
2015-01-01std: Second pass stabilization of syncAlex Crichton-1/+1
This pass performs a second pass of stabilization through the `std::sync` module, avoiding modules/types that are being handled in other PRs (e.g. mutexes, rwlocks, condvars, and channels). The following items are now stable * `sync::atomic` * `sync::atomic::ATOMIC_BOOL_INIT` (was `INIT_ATOMIC_BOOL`) * `sync::atomic::ATOMIC_INT_INIT` (was `INIT_ATOMIC_INT`) * `sync::atomic::ATOMIC_UINT_INIT` (was `INIT_ATOMIC_UINT`) * `sync::Once` * `sync::ONCE_INIT` * `sync::Once::call_once` (was `doit`) * C == `pthread_once(..)` * Boost == `call_once(..)` * Windows == `InitOnceExecuteOnce` * `sync::Barrier` * `sync::Barrier::new` * `sync::Barrier::wait` (now returns a `bool`) * `sync::Semaphore::new` * `sync::Semaphore::acquire` * `sync::Semaphore::release` The following items remain unstable * `sync::SemaphoreGuard` * `sync::Semaphore::access` - it's unclear how this relates to the poisoning story of mutexes. * `sync::TaskPool` - the semantics of a failing task and whether a thread is re-attached to a thread pool are somewhat unclear, and the utility of this type in `sync` is question with respect to the jobs of other primitives. This type will likely become stable or move out of the standard library over time. * `sync::Future` - futures as-is have yet to be deeply re-evaluated with the recent core changes to Rust's synchronization story, and will likely become stable in the future but are unstable until that time comes. [breaking-change]
2014-12-18Fallout from new thread APIAaron Turon-1/+0
2014-12-18Remove rt::{mutex, exclusive}Aaron Turon-3/+2
2014-12-18libs: merge librustrt into libstdAaron Turon-2/+2
This commit merges the `rustrt` crate into `std`, undoing part of the facade. This merger continues the paring down of the runtime system. Code relying on the public API of `rustrt` will break; some of this API is now available through `std::rt`, but is likely to change and/or be removed very soon. [breaking-change]
2014-12-15Remove internal uses of `marker::NoCopy`Jorge Aparicio-3/+0
2014-12-05prefer "FIXME" to "TODO".Aidan Cully-1/+1
2014-12-05work around portability issue on FreeBSD, in which the key returned fromAidan Cully-1/+17
pthread_key_create can be 0.
2014-11-24std: Leak all statically allocated TLS keysAlex Crichton-35/+2
It turns out that rustrt::at_exit() doesn't actually occur after all pthread threads have exited (nor does atexit()), so there's not actually a known point at which we can deallocate these keys. It's not super critical that we do so, however, because we're about to exit anyway! Closes #19280
2014-11-23std: Add a new top-level thread_local moduleAlex Crichton-0/+306
This commit removes the `std::local_data` module in favor of a new `std::thread_local` module providing thread local storage. The module provides two variants of TLS: one which owns its contents and one which is based on scoped references. Each implementation has pros and cons listed in the documentation. Both flavors have accessors through a function called `with` which yield a reference to a closure provided. Both flavors also panic if a reference cannot be yielded and provide a function to test whether an access would panic or not. This is an implementation of [RFC 461][rfc] and full details can be found in that RFC. This is a breaking change due to the removal of the `std::local_data` module. All users can migrate to the new thread local system like so: thread_local!(static FOO: Rc<RefCell<Option<T>>> = Rc::new(RefCell::new(None))) The old `local_data` module inherently contained the `Rc<RefCell<Option<T>>>` as an implementation detail which must now be explicitly stated by users. [rfc]: https://github.com/rust-lang/rfcs/pull/461 [breaking-change]