SET_CURRENT_OBJECT (NULL);
mono_domain_unset ();
- /* Don't need to CloseHandle this thread, even though we took a
+ /* Don't need to close the handle to this thread, even though we took a
* reference in mono_thread_attach (), because the GC will do it
* when the Thread object is finalised.
*/
* when thread_cleanup () can be called after this.
*/
if (thread)
- CloseHandle (thread);
+ mono_threads_close_thread_handle (thread);
if (this_obj->synch_cs) {
MonoCoopMutex *synch_cs = this_obj->synch_cs;
guint32 num;
};
-static void wait_for_tids (struct wait_data *wait, guint32 timeout)
+static void
+wait_for_tids (struct wait_data *wait, guint32 timeout)
{
guint32 i, ret;
}
for(i=0; i<wait->num; i++)
- CloseHandle (wait->handles[i]);
+ mono_threads_close_thread_handle (wait->handles [i]);
if (ret == WAIT_TIMEOUT)
return;
}
for(i=0; i<wait->num; i++)
- CloseHandle (wait->handles[i]);
+ mono_threads_close_thread_handle (wait->handles [i]);
if (ret == WAIT_TIMEOUT)
return;
|| mono_gc_is_finalizer_internal_thread (thread)
|| (thread->flags & MONO_THREAD_FLAG_DONT_MANAGE)
) {
- //CloseHandle (wait->handles [i]);
+ //mono_threads_close_thread_handle (wait->handles [i]);
wait->threads [i] = NULL; /* ignore this thread in next loop */
continue;
}
(thread->state & ThreadState_StopRequested) != 0 ||
(thread->state & ThreadState_Stopped) != 0) {
UNLOCK_THREAD (thread);
- CloseHandle (wait->handles [i]);
+ mono_threads_close_thread_handle (wait->handles [i]);
wait->threads [i] = NULL; /* ignore this thread in next loop */
continue;
}
return mono_threads_platform_open_thread_handle (handle, tid);
}
+void
+mono_threads_close_thread_handle (HANDLE handle)
+{
+ return mono_threads_platform_close_thread_handle (handle);
+}
+
#define INTERRUPT_STATE ((MonoThreadInfoInterruptToken*) (size_t) -1)
struct _MonoThreadInfoInterruptToken {
HANDLE
mono_threads_open_thread_handle (HANDLE handle, MonoNativeThreadId tid);
+void
+mono_threads_close_thread_handle (HANDLE handle);
+
MONO_API void
mono_threads_attach_tools_thread (void);
gboolean mono_threads_platform_yield (void);
void mono_threads_platform_exit (int exit_code);
HANDLE mono_threads_platform_open_thread_handle (HANDLE handle, MonoNativeThreadId tid);
+void mono_threads_platform_close_thread_handle (HANDLE handle);
void mono_threads_platform_set_exited (THREAD_INFO_TYPE *info);
void mono_threads_platform_describe (THREAD_INFO_TYPE *info, GString *text);
void mono_threads_platform_own_mutex (THREAD_INFO_TYPE *info, gpointer mutex_handle);