Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions mono/metadata/marshal.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ enum {
* The marshal lock is a non-recursive complex lock that sits below the domain lock in the
* runtime locking latice. Which means it can take simple locks suck as the image lock.
*/
#define mono_marshal_lock() mono_locks_os_acquire (&marshal_mutex, MarshalLock)
#define mono_marshal_unlock() mono_locks_os_release (&marshal_mutex, MarshalLock)
static mono_mutex_t marshal_mutex;
#define mono_marshal_lock() mono_locks_coop_acquire (&marshal_mutex, MarshalLock)
#define mono_marshal_unlock() mono_locks_coop_release (&marshal_mutex, MarshalLock)
static MonoCoopMutex marshal_mutex;
static gboolean marshal_mutex_initialized;

static MonoNativeTlsKey last_error_tls_id;
Expand Down Expand Up @@ -217,7 +217,7 @@ mono_marshal_init (void)

if (!module_initialized) {
module_initialized = TRUE;
mono_os_mutex_init_recursive (&marshal_mutex);
mono_coop_mutex_init_recursive (&marshal_mutex);
marshal_mutex_initialized = TRUE;

register_icall (ves_icall_System_Threading_Thread_ResetAbort, "ves_icall_System_Threading_Thread_ResetAbort", "void", TRUE);
Expand Down Expand Up @@ -292,7 +292,7 @@ mono_marshal_cleanup (void)

mono_native_tls_free (load_type_info_tls_id);
mono_native_tls_free (last_error_tls_id);
mono_os_mutex_destroy (&marshal_mutex);
mono_coop_mutex_destroy (&marshal_mutex);
marshal_mutex_initialized = FALSE;
}

Expand Down