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

#11 in Concurrency

Download history 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 111622/week @ 2019-09-07 112517/week @ 2019-09-14 114625/week @ 2019-09-21 120495/week @ 2019-09-28 125613/week @ 2019-10-05 124036/week @ 2019-10-12 126498/week @ 2019-10-19 125966/week @ 2019-10-26 129939/week @ 2019-11-02

453,734 downloads per month
Used in 2,349 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