4 instantiations of WaitableObject
System.Private.CoreLib (4)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\WaitSubsystem.WaitableObject.Unix.cs (4)
65new WaitableObject( 77return new WaitableObject(WaitableObjectType.Semaphore, initialSignalCount, maximumSignalCount, null, null); 82return new WaitableObject(WaitableObjectType.Mutex, 1, 1, null, new OwnershipInfo()); 103result = new WaitableObject(WaitableObjectType.Mutex, 1, 1, name, new OwnershipInfo());
73 references to WaitableObject
System.Private.CoreLib (73)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\WaitSubsystem.ThreadWaitInfo.Unix.cs (23)
13/// using <see cref="WaitedListNode"/>s with each <see cref="WaitableObject"/> that the thread is waiting upon. 40/// Information about the current wait, including the type of wait, the <see cref="WaitableObject"/>s involved in 46/// Number of <see cref="WaitableObject"/>s the thread is waiting upon 51/// - <see cref="WaitableObject"/>s that are waited upon by the thread. This array is also used for temporarily 52/// storing <see cref="WaitableObject"/>s corresponding to <see cref="WaitHandle"/>s when the thread is not 57private WaitableObject?[] _waitedObjects; 60/// - Nodes used for registering a thread's wait on each <see cref="WaitableObject"/>, in the 61/// <see cref="WaitableObject.WaitersHead"/> linked list 84/// Linked list of mutex <see cref="WaitableObject"/>s that are owned by the thread and need to be abandoned before 88private WaitableObject? _lockedMutexesHead; 109_waitedObjects = new WaitableObject[1]; 133public WaitableObject?[] GetWaitedObjectArray(int requiredCapacity) 147_waitedObjects = new WaitableObject[Math.Max(requiredCapacity, 187WaitableObject?[] waitedObjects = _waitedObjects; 434if (!WaitableObject.WouldWaitForAllBeSatisfiedOrAborted( 459WaitableObject.SatisfyWaitForAll(this, _waitedObjects, _waitedCount, signaledWaitedObjectIndex); 542public WaitableObject? LockedMutexesHead 586WaitableObject? waitableObject = LockedMutexesHead; 606/// For <see cref="WaitedListNode"/>s registered with <see cref="WaitableObject"/>s, this provides information 607/// about the thread that is waiting and the <see cref="WaitableObject"/>s it is waiting upon 617/// Link in the <see cref="WaitableObject.WaitersHead"/> linked list 682public void RegisterWait(WaitableObject waitableObject) 705public void UnregisterWait(WaitableObject waitableObject)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\WaitSubsystem.Unix.cs (26)
22/// <see cref="WaitableObject"/> 24/// <see cref="Mutex"/>. The handle of each of those classes is associated with a <see cref="WaitableObject"/>. 31/// - Provides functionality to allocate a handle associated with a <see cref="WaitableObject"/>, to retrieve the object 49/// - The waiter registers a <see cref="ThreadWaitInfo.WaitedListNode"/> with each <see cref="WaitableObject"/> 77/// <see cref="WaitableObject"/>s in the process. Given that it is recommended to use alternative synchronization 90/// - <see cref="WaitableObject"/> is intended to be as small as possible while avoiding virtual calls and casts 92/// <see cref="WaitableObject._ownershipInfo"/> 100/// - Threads track owned mutexes by linking the <see cref="WaitableObject.OwnershipInfo"/> instance into a linked list 101/// <see cref="ThreadWaitInfo.LockedMutexesHead"/>. <see cref="WaitableObject.OwnershipInfo"/> is itself a list node, 102/// and is created along with the mutex <see cref="WaitableObject"/>. 106/// simplicity, which p/invokes and does a cast to get the <see cref="WaitableObject"/> from a handle 112/// - Since <see cref="s_lock"/> provides mutual exclusion for the states of all <see cref="WaitableObject"/>s in the 171return NewHandle(WaitableObject.NewEvent(initiallySignaled, resetMode)); 176return NewHandle(WaitableObject.NewSemaphore(initialSignalCount, maximumSignalCount)); 181WaitableObject waitableObject = WaitableObject.NewMutex(); 275SetEvent((WaitableObject)HandleManager.FromHandle(handle)); 278public static void SetEvent(WaitableObject waitableObject) 295ResetEvent((WaitableObject)HandleManager.FromHandle(handle)); 298public static void ResetEvent(WaitableObject waitableObject) 316return ReleaseSemaphore((WaitableObject)HandleManager.FromHandle(handle), count); 319public static int ReleaseSemaphore(WaitableObject waitableObject, int count) 391WaitableObject?[] waitableObjects = waitInfo.GetWaitedObjectArray(waitHandles.Length); 401if (waitableObjectMaybe is not WaitableObject waitableObject) 438WaitableObject waitableObject = waitableObjects[0]!; 445WaitableObject.Wait(
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\WaitSubsystem.WaitableObject.Unix.cs (24)
22private static Dictionary<string, WaitableObject>? s_namedObjects; 60public static WaitableObject NewEvent(bool initiallySignaled, EventResetMode resetMode) 75public static WaitableObject NewSemaphore(int initialSignalCount, int maximumSignalCount) 80public static WaitableObject NewMutex() 85public static WaitableObject? CreateNamedMutex_Locked(string name, out bool createdNew) 89s_namedObjects ??= new Dictionary<string, WaitableObject>(); 91if (s_namedObjects.TryGetValue(name, out WaitableObject? result)) 110public static OpenExistingResult OpenNamedMutex(string name, out WaitableObject? result) 340WaitableObject?[] waitableObjects = waitInfo.GetWaitedObjectArray(1); 353WaitableObject?[]? waitableObjects, 383WaitableObject waitableObject = waitableObjects[i]!; 420WaitableObject waitableObject = waitableObjects[i]!; 454WaitableObject waitableObject = waitableObjects[i]!; 502WaitableObject?[] waitedObjects, 526WaitableObject waitedObject = waitedObjects[i]!; 559WaitableObject?[] waitedObjects, 580WaitableObject waitedObject = waitedObjects[i]!; 827private WaitableObject? _previous; 832private WaitableObject? _next; 852public void AssignOwnership(WaitableObject waitableObject, ThreadWaitInfo waitInfo) 868WaitableObject? head = waitInfo.LockedMutexesHead; 877public void RelinquishOwnership(WaitableObject waitableObject, bool isAbandoned) 897WaitableObject? previous = _previous; 898WaitableObject? next = _next;