17 releases (1 stable)

1.0.0 Sep 7, 2019
0.3.6 Aug 15, 2018
0.3.5 Dec 9, 2017
0.3.4 Jun 27, 2017
0.2.6 May 30, 2016

#6 in Concurrency

Download history 105052/week @ 2019-05-25 103315/week @ 2019-06-01 103318/week @ 2019-06-08 109548/week @ 2019-06-15 107767/week @ 2019-06-22 90858/week @ 2019-06-29 95299/week @ 2019-07-06 99553/week @ 2019-07-13 103551/week @ 2019-07-20 106484/week @ 2019-07-27 110689/week @ 2019-08-03 113837/week @ 2019-08-10 108572/week @ 2019-08-17 106953/week @ 2019-08-24 112700/week @ 2019-08-31

453,734 downloads per month
Used in 2,372 crates (16 directly)

Apache-2.0/MIT

33KB
642 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 = "1.0"

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