about summary refs log tree commit diff
path: root/src/libstd/sync
diff options
context:
space:
mode:
authorAleksey Kladov <aleksey.kladov@gmail.com>2018-08-03 14:18:06 +0300
committerGitHub <noreply@github.com>2018-08-03 14:18:06 +0300
commit94de821002f3378a59c2bf812ce73756f3ed0512 (patch)
treee711040a3a02e31ab53f779ca0d745373f3b3d4a /src/libstd/sync
parent4dae47051315793d4d4d043b4b8b03c51e3dc877 (diff)
downloadrust-94de821002f3378a59c2bf812ce73756f3ed0512.tar.gz
rust-94de821002f3378a59c2bf812ce73756f3ed0512.zip
Specify reentrancy gurantees of `Once::call_once`
Diffstat (limited to 'src/libstd/sync')
-rw-r--r--src/libstd/sync/once.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libstd/sync/once.rs b/src/libstd/sync/once.rs
index 10282ecb658..113fbbf1f61 100644
--- a/src/libstd/sync/once.rs
+++ b/src/libstd/sync/once.rs
@@ -178,6 +178,10 @@ impl Once {
     /// happens-before relation between the closure and code executing after the
     /// return).
     ///
+    /// If the given closure recusively invokes `call_once` on the same `Once` 
+    /// instance the exact behavior is not specified, allowed outcomes are
+    /// a panic or a deadlock.
+    ///
     /// # Examples
     ///
     /// ```