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

#3 in Concurrency

Download history 43825/week @ 2018-08-07 50209/week @ 2018-08-14 57398/week @ 2018-08-21 58128/week @ 2018-08-28 60498/week @ 2018-09-04 62916/week @ 2018-09-11 64183/week @ 2018-09-18 61038/week @ 2018-09-25 64111/week @ 2018-10-02 66821/week @ 2018-10-09 66820/week @ 2018-10-16 62262/week @ 2018-10-23 58577/week @ 2018-10-30

215,710 downloads per month
Used in 3,589 crates (13 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

~10KB