rust-lang-nursery / lazy-static.rs

A small macro for defining lazy evaluated static variables in Rust.
Apache License 2.0
1.93k stars 112 forks source link

Document that cyclic dependencies cause deadlock #37

Closed ciphergoth closed 7 years ago

ciphergoth commented 8 years ago

A cycle in the evaluation of lazy_statics will cause deadlock when one is evaluated. I tested this by adding m.insert(*COUNT as u32, "deadlock"); to the hashmap in the sample program. This makes perfect sense, but seems worth adding to the documentation.

Kimundi commented 7 years ago

Hi, I'm sincerely sorry for taking so long to respond.

I'll add a sentence about this to the docs.

Kimundi commented 7 years ago

Done, should be reflected in the docs as soon as the doc builds finish.

ciphergoth commented 7 years ago

That's great, thank you so much, and please don't feel the need to apologise - I'm grateful for all the work you do on Rust!