@@ -18,22 +18,18 @@ use std::sync::atomics;
18
18
19
19
use mutex:: { StaticMutex , MUTEX_INIT } ;
20
20
21
- /// A type which can be used to run a one-time global initialization. This type
22
- /// is *unsafe* to use because it is built on top of the `Mutex` in this module.
23
- /// It does not know whether the currently running task is in a green or native
24
- /// context, and a blocking mutex should *not* be used under normal
25
- /// circumstances on a green task.
26
- ///
27
- /// Despite its unsafety, it is often useful to have a one-time initialization
28
- /// routine run for FFI bindings or related external functionality. This type
29
- /// can only be statically constructed with the `ONCE_INIT` value.
21
+ /// A synchronization primitive which can be used to run a one-time global
22
+ /// initialization. Useful for one-time initialization for FFI or related
23
+ /// functionality. This type can only be constructed with the `ONCE_INIT`
24
+ /// value.
30
25
///
31
26
/// # Example
32
27
///
33
28
/// ```rust
34
29
/// use sync::one::{Once, ONCE_INIT};
35
30
///
36
31
/// static mut START: Once = ONCE_INIT;
32
+ ///
37
33
/// unsafe {
38
34
/// START.doit(|| {
39
35
/// // run initialization here
@@ -58,7 +54,7 @@ impl Once {
58
54
/// will be executed if this is the first time `doit` has been called, and
59
55
/// otherwise the routine will *not* be invoked.
60
56
///
61
- /// This method will block the calling *os thread* if another initialization
57
+ /// This method will block the calling task if another initialization
62
58
/// routine is currently running.
63
59
///
64
60
/// When this function returns, it is guaranteed that some initialization
0 commit comments