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

#6 in Concurrency

Download history 50628/week @ 2018-10-23 68334/week @ 2018-10-30 66662/week @ 2018-11-06 68773/week @ 2018-11-13 64968/week @ 2018-11-20 61383/week @ 2018-11-27 69182/week @ 2018-12-04 76805/week @ 2018-12-11 71385/week @ 2018-12-18 57401/week @ 2018-12-25 52209/week @ 2019-01-01 72936/week @ 2019-01-08 63198/week @ 2019-01-15

215,710 downloads per month
Used in 4,024 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