@@ -101,6 +101,7 @@ bool TRI_StartThread(TRI_thread_t* thread, TRI_tid_t* threadId,
101
101
// //////////////////////////////////////////////////////////////////////////////
102
102
103
103
int TRI_JoinThread (TRI_thread_t* thread) {
104
+ TRI_ASSERT (thread != nullptr );
104
105
DWORD result = WaitForSingleObject (*thread, INFINITE);
105
106
106
107
switch (result) {
@@ -136,7 +137,8 @@ int TRI_JoinThread(TRI_thread_t* thread) {
136
137
int TRI_DetachThread (TRI_thread_t* thread) {
137
138
// If the function succeeds, the return value is nonzero.
138
139
// If the function fails, the return value is zero. To get extended error information, call GetLastError.
139
- BOOL res = CloseHandle (thread);
140
+ TRI_ASSERT (thread != nullptr );
141
+ BOOL res = CloseHandle (*thread);
140
142
141
143
if (res == 0 ) {
142
144
DWORD result = GetLastError ();
@@ -157,7 +159,8 @@ bool TRI_IsSelfThread(TRI_thread_t* thread) {
157
159
// TODO: Change the TRI_thread_t into a structure which stores the thread id
158
160
// as well as the thread handle. This can then be passed around
159
161
// ...........................................................................
160
- return (GetCurrentThreadId () == GetThreadId (thread));
162
+ TRI_ASSERT (thread != nullptr );
163
+ return (GetCurrentThreadId () == GetThreadId (*thread));
161
164
}
162
165
163
166
// //////////////////////////////////////////////////////////////////////////////
0 commit comments