matklad / once_cell

Rust library for single assignment cells and lazy statics without macros
Apache License 2.0
1.84k stars 110 forks source link

Add synchronization note to get_unchecked #70

Closed pitdicker closed 4 years ago

pitdicker commented 4 years ago

The caller not only has to make sure that the cell is initialized, but also that the data is acquired by the current thread. I can't imagine any scenario where you know it is initialized but where you didn't do an acquire yet, but it seems good to document.

matklad commented 4 years ago

bors r+

Thanks!

bors[bot] commented 4 years ago

Build succeeded