Skip to content

Commit 21c02bd

Browse files
comment on safety
1 parent 7735024 commit 21c02bd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/backtrace/win32.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ impl Frame {
9494
#[repr(C, align(16))] // required by `CONTEXT`, is a FIXME in windows metadata right now
9595
struct MyContext(CONTEXT);
9696

97+
/// # Safety
98+
/// This function makes many calls to dbghelp, which must be called in a single-threaded fashion.
99+
/// Therefore, it is unsound to call this function concurrently without synchronization.
97100
#[inline(always)]
98101
pub unsafe fn trace(cb: &mut dyn FnMut(&super::Frame) -> bool) {
99102
// Allocate necessary structures for doing the stack walk

0 commit comments

Comments
 (0)