binary_protocol_thread_register ((gpointer)mono_thread_info_get_tid (info));
+ /* On win32, stack_start_limit should be 0, since the stack can grow dynamically */
+#ifndef HOST_WIN32
mono_thread_info_get_stack_bounds (&staddr, &stsize);
+#endif
if (staddr) {
info->stack_start_limit = staddr;
info->stack_end = staddr + stsize;
static void
sgen_thread_unregister (SgenThreadInfo *p)
{
- binary_protocol_thread_unregister ((gpointer)mono_thread_info_get_tid (p));
- SGEN_LOG (3, "unregister thread %p (%p)", p, (gpointer)mono_thread_info_get_tid (p));
+ MonoNativeThreadId tid;
+
+ tid = mono_thread_info_get_tid (p);
+ binary_protocol_thread_unregister ((gpointer)tid);
+ SGEN_LOG (3, "unregister thread %p (%p)", p, (gpointer)tid);
+
+ mono_threads_add_joinable_thread ((gpointer)tid);
if (gc_callbacks.thread_detach_func) {
gc_callbacks.thread_detach_func (p->runtime_data);
void
mono_gc_pthread_exit (void *retval)
{
- mono_thread_info_dettach ();
+ mono_thread_info_detach ();
pthread_exit (retval);
}
cb.thread_attach = sgen_thread_attach;
cb.mono_method_is_critical = (gpointer)is_critical_method;
#ifndef HOST_WIN32
+ cb.thread_exit = mono_gc_pthread_exit;
cb.mono_gc_pthread_create = (gpointer)mono_gc_pthread_create;
#endif