about summary refs log tree commit diff
path: root/src/libstd/thread_local/scoped.rs
AgeCommit message (Collapse)AuthorLines
2015-01-07markers -> markerNick Cameron-5/+5
2015-01-07Change `std::kinds` to `std::markers`; flatten `std::kinds::marker`Nick Cameron-5/+5
[breaking-change]
2015-01-05Stop using macro_escape as an inner attributeKeegan McAllister-1/+0
In preparation for the rename.
2015-01-03Initial version of AArch64 support.Akos Kiss-7/+13
Adds AArch64 knowledge to: * configure, * make files, * sources, * tests, and * documentation.
2015-01-02rollup merge of #20354: alexcrichton/second-pass-thread_localAlex Crichton-10/+15
Conflicts: src/libstd/sys/common/thread_info.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
2014-12-31std: Second pass stabilization for thread_localAlex Crichton-10/+15
This commit performs a second pass over the `std::thread_local` module. Most of the functionality remains explicitly unstable, but the specific actions taken were: * `thread_local` is now stable * `thread_local!` is now stable * `thread_local::Key` is now stable * `thread_local::Key::with` is now stable * `thread_local::Key::destroyed` is deprecated in favor of a more general `state` function * `thread_local::Key::state` was added to query the three states that a key can be in: uninitialized, valid, or destroyed. This function, and the corresponding `State` enum, are both marked unstable as we may wish to expand it later on. * `thread_local::scoped` is entirely unstable. There hasn't been a whole lot of usage of this module in the standard distribution, so it remains unstable at this time. Note that while the structure `Key` is marked stable, it is currently forced to expose all of its implementation details due to the use of construction-via-macro. The use of construction-via-macro is currently required in order to place the `#[thread_local]` attribute on static in a platform-specific manner. These stability attributes were assigned assuming that it will be acceptable to tweak the implementation of `Key` in the future.
2014-12-28src/libstd/thread_local/scoped.rs: fixes scoped_thread_local! macroarturo-2/+16
was missing a ;
2014-12-26Relax `Arc` bounds don't require Sync+SendFlavio Percoco-2/+2
Besides the above making sense, it'll also allow us to make `RacyCell` private and use UnsafeCell instead.
2014-12-26Move RacyCell to `std::comm`Flavio Percoco-3/+2
RacyCell is not exactly what we'd like as a final implementation for this. Therefore, we're moving it under `std::comm` and also making it private.
2014-12-26Make Send and Sync traits unsafeFlavio Percoco-2/+2
2014-12-26Require types to opt-in SyncFlavio Percoco-1/+5
2014-12-23Fix some spelling errors.Huon Wilson-1/+1
2014-12-18Avoid .take().unwrap() with FnOnce closuresAlex Crichton-1/+0
2014-12-18librustc: Always parse `macro!()`/`macro![]` as expressions if notPatrick Walton-9/+9
followed by a semicolon. This allows code like `vec![1i, 2, 3].len();` to work. This breaks code that uses macros as statements without putting semicolons after them, such as: fn main() { ... assert!(a == b) assert!(c == d) println(...); } It also breaks code that uses macros as items without semicolons: local_data_key!(foo) fn main() { println("hello world") } Add semicolons to fix this code. Those two examples can be fixed as follows: fn main() { ... assert!(a == b); assert!(c == d); println(...); } local_data_key!(foo); fn main() { println("hello world") } RFC #378. Closes #18635. [breaking-change]
2014-12-13libstd: use unboxed closuresJorge Aparicio-2/+6
2014-11-23std: Add a new top-level thread_local moduleAlex Crichton-0/+261
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]