16 releases

0.3.6 Aug 15, 2018
0.3.5 Dec 9, 2017
0.3.4 Jun 27, 2017
0.3.3 Feb 20, 2017
0.2.6 May 30, 2016

#16 in Concurrency

Download history 78318/week @ 2019-01-23 79292/week @ 2019-01-30 85384/week @ 2019-02-06 86220/week @ 2019-02-13 89364/week @ 2019-02-20 95772/week @ 2019-02-27 92572/week @ 2019-03-06 92496/week @ 2019-03-13 85399/week @ 2019-03-20 85243/week @ 2019-03-27 97522/week @ 2019-04-03 100185/week @ 2019-04-10 88332/week @ 2019-04-17 92929/week @ 2019-04-24 86757/week @ 2019-05-01

401,393 downloads per month
Used in 5,331 crates (15 directly)

Apache-2.0/MIT

32KB
602 lines

thread_local

Build Status Crates.io

This library provides the ThreadLocal and CachedThreadLocal types which allow a separate copy of an object to be used for each thread. This allows for per-object thread-local storage, unlike the standard library's thread_local! macro which only allows static thread-local storage.

Documentation

Usage

Add this to your Cargo.toml:

[dependencies]
thread_local = "0.3"

and this to your crate root:

extern crate thread_local;

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~9KB