4 using System.Collections.Generic;
7 using System.Threading;
9 namespace SiliconStudio.
Paradox.Threading
21 SetDefaultLockMechanism(Standard);
22 _originalDefaultLockMechanism = Default;
27 if (defaultLockMechanism == null)
28 throw new ArgumentNullException(
"defaultLockMechanism");
30 Default = defaultLockMechanism;
36 Default = _originalDefaultLockMechanism;
43 public object OnBegin(
object syncRoot, Action action)
45 Monitor.Enter(syncRoot);
49 public void OnEnd(
object syncRoot)
51 Monitor.Exit(syncRoot);
57 private static readonly
object _globalLock =
new object();
59 public object OnBegin(
object syncRoot, Action action)
61 Monitor.Enter(_globalLock);
65 public void OnEnd(
object syncRoot)
67 Monitor.Exit(_globalLock);
static ILockMechanism Default
static void SetDefaultLockMechanism(ILockMechanism defaultLockMechanism)
void OnEnd(object syncRoot)
object OnBegin(object syncRoot, Action action)
static ILockMechanism RestoreDefaultLockMechanism()
void OnEnd(object syncRoot)
object OnBegin(object syncRoot, Action action)