read-write-store 0.2.0

A concurrent, unordered collection for Rust, where each element has an internally generated ID and a read-write lock.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::collections::hash_map::DefaultHasher;
use std::hash::{Hash, Hasher};

#[cfg(not(loom))]
pub fn current_thread_hash() -> u64 {
    let mut hasher = DefaultHasher::new();
    std::thread::current().id().hash(&mut hasher);
    hasher.finish()
}

#[cfg(loom)]
pub fn current_thread_hash() -> u64 {
    let mut hasher = DefaultHasher::new();
    loom::thread::current().id().hash(&mut hasher);
    hasher.finish()
}