published_value
published_value
allows one thread to "publish" a value to a number of
other threads. The other threads can wait for the value to be published and
receive an immutable reference to the value once it is. Once published the
value is immutable. Requests for the value after it's been published are
efficient and do not require obtaining a lock.
Examples
let = new;
let thread1 = spawn;
let thread2 = spawn;
publisher.publish;
assert_eq!;
assert_eq!;