1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
use crateThreadId;
use crate;
use crateget_current_thread_id;
use c_int;
/// Register a thread spawn with the global detector.
///
/// This function should be called when a new thread is created to enable
/// proper tracking of thread relationships and resources.
///
/// # Arguments
/// * `thread_id` - ID of the spawned thread.
/// * `parent_id` - ID of the parent thread that created this thread, or 0 for no parent.
///
/// # Returns
/// * `0` on success
///
/// # Safety
/// - The caller must ensure thread_id represents a real thread.
/// - This function is normally called automatically by the CREATE_TRACKED_THREAD macro.
pub unsafe extern "C"
/// Register a thread exit with the global detector.
///
/// This function should be called when a thread is about to exit to ensure
/// proper cleanup of resources owned by the thread.
///
/// # Arguments
/// * `thread_id` - ID of the exiting thread.
///
/// # Returns
/// * `0` on success
///
/// # Safety
/// - The caller must ensure thread_id represents a real thread that is exiting.
/// - This function is normally called automatically by the CREATE_TRACKED_THREAD macro.
pub unsafe extern "C"
/// Get the current thread ID.
///
/// Returns a unique identifier for the current thread that can be used
/// with other Deloxide functions.
///
/// # Returns
/// A unique identifier for the current thread as an unsigned long
///
/// # Safety
/// This function is safe to call from FFI contexts.
pub unsafe extern "C"