#include <mono/utils/mono-tls.h>
#include <mono/utils/mono-mmap.h>
#include <mono/metadata/threads-types.h>
+#include <mono/metadata/gc-internal.h>
#include <limits.h>
#include <errno.h>
/* Run the actual main function of the thread */
result = start_func (t_arg);
- /*
- mono_thread_info_detach ();
- */
-
-#if defined(__native_client__)
- nacl_shutdown_gc_thread();
-#endif
-
- wapi_thread_handle_set_exited (handle, GPOINTER_TO_UINT (result));
- /* This is needed by mono_threads_core_unregister () which is called later */
- info->handle = NULL;
-
- g_assert (mono_threads_get_callbacks ()->thread_exit);
- mono_threads_get_callbacks ()->thread_exit (NULL);
+ mono_threads_core_exit (GPOINTER_TO_UINT (result));
g_assert_not_reached ();
- return result;
}
HANDLE
MONO_SEM_INIT (&(start_info.registered), 0);
/* Actually start the thread */
- res = mono_threads_get_callbacks ()->mono_gc_pthread_create (&thread, &attr, inner_start_thread, &start_info);
+ res = mono_gc_pthread_create (&thread, &attr, inner_start_thread, &start_info);
if (res) {
MONO_SEM_DESTROY (&(start_info.registered));
return NULL;
wapi_thread_handle_set_exited (current->handle, exit_code);
- g_assert (mono_threads_get_callbacks ()->thread_exit);
- mono_threads_get_callbacks ()->thread_exit (NULL);
+ mono_thread_info_detach ();
+
+ pthread_exit (NULL);
}
void
return handle;
}
-gpointer
-mono_threads_core_prepare_interrupt (HANDLE thread_handle)
-{
- return wapi_prepare_interrupt_thread (thread_handle);
-}
-
-void
-mono_threads_core_finish_interrupt (gpointer wait_handle)
-{
- wapi_finish_interrupt_thread (wait_handle);
-}
-
-void
-mono_threads_core_self_interrupt (void)
-{
- wapi_self_interrupt ();
-}
-
-void
-mono_threads_core_clear_interruption (void)
-{
- wapi_clear_interruption ();
-}
-
int
mono_threads_pthread_kill (MonoThreadInfo *info, int signum)
{
#elif defined(__native_client__)
/* Workaround pthread_kill abort() in NaCl glibc. */
return 0;
+#elif !defined(HAVE_PTHREAD_KILL)
+ g_error ("pthread_kill() is not supported by this platform");
#else
return pthread_kill (mono_thread_info_get_tid (info), signum);
#endif