18 releases (2 stable)

1.0.1 Jan 11, 2020
1.0.0 Sep 7, 2019
0.3.6 Aug 15, 2018
0.3.5 Dec 9, 2017
0.2.6 May 30, 2016

#9 in Concurrency

Download history 123823/week @ 2019-10-11 127411/week @ 2019-10-18 127343/week @ 2019-10-25 125953/week @ 2019-11-01 130662/week @ 2019-11-08 130284/week @ 2019-11-15 133766/week @ 2019-11-22 129471/week @ 2019-11-29 139590/week @ 2019-12-06 130661/week @ 2019-12-13 89253/week @ 2019-12-20 86877/week @ 2019-12-27 128708/week @ 2020-01-03 231610/week @ 2020-01-10 192761/week @ 2020-01-17

536,629 downloads per month
Used in 2,367 crates (18 directly)

Apache-2.0/MIT

32KB
640 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

~12KB