gpointer stopped_ip; /* only valid if the thread is stopped */
MonoDomain *stopped_domain; /* dsto */
+
+ /*
+ This is set the argument of mono_gc_set_skip_thread.
+
+ A thread that knowingly holds no managed state can call this
+ function around blocking loops to reduce the GC burden by not
+ been scanned.
+ */
+ gboolean gc_disabled;
};
#else
return &major_collector;
}
-void mono_gc_set_skip_thread (gboolean skip)
-{
- SgenThreadInfo *info = mono_thread_info_current ();
-
- LOCK_GC;
- info->gc_disabled = skip;
- UNLOCK_GC;
-}
-
SgenRememberedSet*
sgen_get_remset (void)
{
struct _SgenThreadInfo {
SgenClientThreadInfo client_info;
- /*
- This is set the argument of mono_gc_set_skip_thread.
-
- A thread that knowingly holds no managed state can call this
- function around blocking loops to reduce the GC burden by not
- been scanned.
- */
- gboolean gc_disabled;
void *stack_end;
void *stack_start;
void *stack_start_limit;
info->client_info.stopped_domain = NULL;
}
+void
+mono_gc_set_skip_thread (gboolean skip)
+{
+ SgenThreadInfo *info = mono_thread_info_current ();
+
+ LOCK_GC;
+ info->client_info.gc_disabled = skip;
+ UNLOCK_GC;
+}
+
static gboolean
is_critical_method (MonoMethod *method)
{
SGEN_LOG (3, "Skipping dead thread %p, range: %p-%p, size: %td", info, info->stack_start, info->stack_end, (char*)info->stack_end - (char*)info->stack_start);
continue;
}
- if (info->gc_disabled) {
+ if (info->client_info.gc_disabled) {
SGEN_LOG (3, "GC disabled for thread %p, range: %p-%p, size: %td", info, info->stack_start, info->stack_end, (char*)info->stack_end - (char*)info->stack_start);
continue;
}
continue;
info->client_info.suspend_done = FALSE;
- if (info->gc_disabled)
+ if (info->client_info.gc_disabled)
continue;
if (suspend) {
continue;
}
info->client_info.suspend_done = FALSE;
- if (info->gc_disabled)
+ if (info->client_info.gc_disabled)
continue;
/*if (signum == suspend_signal_num && info->stop_count == global_stop_count)
continue;*/
if (info == current)
continue;
info->client_info.suspend_done = FALSE;
- if (info->gc_disabled)
+ if (info->client_info.gc_disabled)
continue;
if (suspend) {
if (!sgen_suspend_thread (info))
allocator */
FOREACH_THREAD_SAFE (info) {
gboolean result;
- if (info->client_info.skip || info->gc_disabled || info->client_info.suspend_done)
+ if (info->client_info.skip || info->client_info.gc_disabled || info->client_info.suspend_done)
continue;
if (mono_thread_info_is_live (info) &&
(!info->stack_start || info->client_info.in_critical_region || info->client_info.info.inside_critical_region ||
This is used by TP and finalizer threads.
FIXME Use an atomic variable for this to avoid everyone taking the GC LOCK.
*/
- if (info->gc_disabled) {
+ if (info->client_info.gc_disabled) {
return FALSE;
}