Skip to content

Commit

Permalink
[runtime]Add the marshal lock to the lock tracer.
Browse files Browse the repository at this point in the history
  • Loading branch information
kumpera committed Dec 5, 2013
1 parent f274be9 commit e90df12
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions data/lock-decoder/LockTracerDecoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ public enum Lock {
DomainAssembliesLock,
DomainJitCodeHashLock,
IcallLock,
AssemblyBindingLock,
MarshalLock,
}

public class SimLock
Expand Down
1 change: 1 addition & 0 deletions mono/metadata/lock-tracer.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ typedef enum {
DomainJitCodeHashLock,
IcallLock,
AssemblyBindingLock,
MarshalLock
} RuntimeLocks;

#ifdef LOCK_TRACER
Expand Down
9 changes: 5 additions & 4 deletions mono/metadata/marshal.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,12 @@ typedef struct _MonoRemotingMethods MonoRemotingMethods;
/*
* This mutex protects the various marshalling related caches in MonoImage
* and a few other data structures static to this file.
* Note that when this lock is held it is not possible to take other runtime
* locks like the loader lock.
*
* 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() EnterCriticalSection (&marshal_mutex)
#define mono_marshal_unlock() LeaveCriticalSection (&marshal_mutex)
#define mono_marshal_lock() mono_locks_acquire (&marshal_mutex, MarshalLock)
#define mono_marshal_unlock() mono_locks_release (&marshal_mutex, MarshalLock)
static CRITICAL_SECTION marshal_mutex;
static gboolean marshal_mutex_initialized;

Expand Down

0 comments on commit e90df12

Please sign in to comment.