Skip to content

Commit eae87a9

Browse files
committed
Note in the docs that initialization cycles can lead to deadlocks
1 parent f026ac2 commit eae87a9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ implements `Deref<TYPE>` and stores it in a static with name `NAME`. (Metadata e
2626
attaching to this type.)
2727
2828
On first deref, `EXPR` gets evaluated and stored internally, such that all further derefs
29-
can return a reference to the same object.
29+
can return a reference to the same object. Note that this can lead to deadlocks
30+
if you have multiple lazy statics that depend on each other in their initialization.
3031
3132
Like regular `static mut`s, this macro only works for types that fulfill the `Sync`
3233
trait.

0 commit comments

Comments
 (0)