Skip to content

Commit 7602e3f

Browse files
committed
thread_loca::guard: make the enable contract more explicit
1 parent 20479b7 commit 7602e3f

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

library/std/src/sys/thread_local/guard/windows.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ impl Drop for EnableGuard {
106106
}
107107
}
108108

109+
/// Set up the current thread to invoke `cleanup` when it finishes.
109110
pub fn enable() {
110111
let registered = if cfg!(target_thread_local) {
111112
#[thread_local]

library/std/src/sys/thread_local/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ pub(crate) mod destructors {
8181

8282
/// This module provides a way to schedule the execution of the destructor list
8383
/// and the [runtime cleanup](crate::rt::thread_cleanup) function. Calling `enable`
84-
/// should ensure that these functions are called at the right times.
84+
/// sets up the current thread to ensure that these functions are called at the right times.
8585
pub(crate) mod guard {
8686
cfg_select! {
8787
all(target_thread_local, target_vendor = "apple") => {

0 commit comments

Comments
 (0)