Skip to content

Commit 03f0f8f

Browse files
committed
improve windows tls documentation
1 parent 3c1b697 commit 03f0f8f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/shims/tls.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,12 @@ trait EvalContextPrivExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
244244
this.eval_windows("thread_local_key", "p_thread_callback")?.to_pointer(this)?;
245245
let thread_callback = this.get_ptr_fn(thread_callback)?.as_instance()?;
246246

247-
// Technically, the reason should be `DLL_PROCESS_DETACH` when the main thread exits but std ignores it.
247+
// Technically, the reason should be `DLL_PROCESS_DETACH` when the main thread exits but std treats both the same.
248248
let reason = this.eval_windows("c", "DLL_THREAD_DETACH")?;
249249

250250
// The signature of this function is `unsafe extern "system" fn(h: c::LPVOID, dwReason: c::DWORD, pv: c::LPVOID)`.
251+
// `h` should be a handle to the current module and what `pv` should be is unknown
252+
// but both are ignored by std
251253
this.call_function(
252254
thread_callback,
253255
Abi::System { unwind: false },

0 commit comments

Comments
 (0)