Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ UnregisterWait() [2/2]

void System.Threading.PortableThreadPool.WaitThread.UnregisterWait ( RegisteredWaitHandle handle,
bool blocking )
inlineprivate

Definition at line 958 of file PortableThreadPool.cs.

959 {
960 bool flag = false;
961 PortableThreadPool threadPoolInstance = ThreadPoolInstance;
962 threadPoolInstance._waitThreadLock.Acquire();
963 try
964 {
965 if (Array.IndexOf(_registeredWaits, handle) != -1)
966 {
967 if (Array.IndexOf(_pendingRemoves, handle) == -1)
968 {
971 }
972 flag = true;
973 }
974 }
975 finally
976 {
977 threadPoolInstance._waitThreadLock.Release();
978 }
979 if (blocking)
980 {
981 if (handle.IsBlocking)
982 {
983 handle.WaitForCallbacks();
984 }
985 else if (flag)
986 {
987 handle.WaitForRemoval();
988 }
989 }
990 }
readonly RegisteredWaitHandle[] _registeredWaits
readonly RegisteredWaitHandle[] _pendingRemoves
static readonly PortableThreadPool ThreadPoolInstance

References System.Threading.PortableThreadPool.WaitThread._changeHandlesEvent, System.Threading.PortableThreadPool.WaitThread._numPendingRemoves, System.Threading.PortableThreadPool.WaitThread._pendingRemoves, System.Threading.PortableThreadPool.WaitThread._registeredWaits, System.Threading.PortableThreadPool._waitThreadLock, System.Threading.LowLevelLock.Acquire(), System.handle, System.Array.IndexOf(), System.Threading.LowLevelLock.Release(), System.Threading.EventWaitHandle.Set(), and System.Threading.PortableThreadPool.ThreadPoolInstance.