store_remset_buffer_index_addr = &store_remset_buffer_index;
#endif
-#if defined(__MACH__)
- info->mach_port = mach_thread_self ();
-#endif
-
/* try to get it with attributes first */
#if defined(HAVE_PTHREAD_GETATTR_NP) && defined(HAVE_PTHREAD_ATTR_GETSTACK)
{
binary_protocol_thread_unregister ((gpointer)mono_thread_info_get_tid (p));
DEBUG (3, fprintf (gc_debug_file, "unregister thread %p (%p)\n", p, (gpointer)mono_thread_info_get_tid (p)));
-#if defined(__MACH__)
- mach_port_deallocate (current_task (), p->mach_port);
-#endif
-
if (gc_callbacks.thread_detach_func) {
gc_callbacks.thread_detach_func (p->runtime_data);
p->runtime_data = NULL;
#include <mono/metadata/sgen-gray.h>
#include <mono/metadata/sgen-hash-table.h>
-#if defined(__MACH__)
- #include <mach/mach_port.h>
-#endif
-
/* The method used to clear the nursery */
/* Clearing at nursery collections is the safest, but has bad interactions with caches.
* Clearing at TLAB creation is much faster, but more complex and it might expose hard
};
/* eventually share with MonoThread? */
+/*
+ * This structure extends the MonoThreadInfo structure.
+ */
struct _SgenThreadInfo {
MonoThreadInfo info;
-#if defined(__MACH__)
- thread_port_t mach_port;
-#else
- int signal;
- unsigned int stop_count; /* to catch duplicate signals */
-#endif
int skip;
volatile int in_critical_region;
gboolean joined_stw;
RememberedSet *remset;
gpointer runtime_data;
+ /* Only used on POSIX platforms */
+ int signal;
+ /* Ditto */
+ unsigned int stop_count; /* to catch duplicate signals */
+
gpointer stopped_ip; /* only valid if the thread is stopped */
MonoDomain *stopped_domain; /* ditto */
gboolean
sgen_resume_thread (SgenThreadInfo *info)
{
- return thread_resume (info->mach_port) == KERN_SUCCESS;
+ return thread_resume (info->info.native_handle) == KERN_SUCCESS;
}
gboolean
state = (thread_state_t) alloca (mono_mach_arch_get_thread_state_size ());
mctx = (mcontext_t) alloca (mono_mach_arch_get_mcontext_size ());
- ret = thread_suspend (info->mach_port);
+ ret = thread_suspend (info->info.native_handle);
if (ret != KERN_SUCCESS)
return FALSE;
- ret = mono_mach_arch_get_thread_state (info->mach_port, state, &num_state);
+ ret = mono_mach_arch_get_thread_state (info->info.native_handle, state, &num_state);
if (ret != KERN_SUCCESS)
return FALSE;
g_assert (info->doing_handshake);
info->doing_handshake = FALSE;
- ret = thread_resume (info->mach_port);
+ ret = thread_resume (info->info.native_handle);
if (ret != KERN_SUCCESS)
continue;
}