* end up running them while or after the domain is being cleared, so
* the objects will not be valid anymore.
*/
- if (!mono_domain_is_unloading (domain)) {
- MONO_TRY_BLOCKING;
+ if (!mono_domain_is_unloading (domain))
mono_gc_register_for_finalization (obj, callback);
- MONO_FINISH_TRY_BLOCKING;
- }
#endif
}
* ######## Global data.
* ######################################################################
*/
-LOCK_DECLARE (gc_mutex);
+MonoCoopMutex gc_mutex;
gboolean sgen_try_free_some_memory;
#define SCAN_START_SIZE SGEN_SCAN_START_SIZE
mono_thread_smr_init ();
#endif
- LOCK_INIT (gc_mutex);
+ mono_coop_mutex_init (&gc_mutex);
gc_debug_file = stderr;
void
sgen_gc_lock (void)
{
- MONO_TRY_BLOCKING;
- mono_os_mutex_lock (&gc_mutex);
- MONO_FINISH_TRY_BLOCKING;
+ mono_coop_mutex_lock (&gc_mutex);
}
void
{
gboolean try_free = sgen_try_free_some_memory;
sgen_try_free_some_memory = FALSE;
- mono_os_mutex_unlock (&gc_mutex);
+ mono_coop_mutex_unlock (&gc_mutex);
if (try_free)
mono_thread_hazardous_try_free_some ();
}
extern NurseryClearPolicy nursery_clear_policy;
extern gboolean sgen_try_free_some_memory;
-extern LOCK_DECLARE (gc_mutex);
+extern MonoCoopMutex gc_mutex;
/* Nursery helpers. */