Beispiel #1
0
		/*
		 * This is called by some arbitrary thread to release the mutex.
		 */
 
		internal StMutex Abandon ()
		{
			count = -1;
			head.request = 0;

			if (prev != null) {
				prev.next = next;
			}

			if (next != null) {
				next.prev = prev;
			}

			var ret = next;
			prev = next = null;

			ReleaseWorker (false);

			return ret;
		}
Beispiel #2
0
		internal void Release (StMutex mutex)
		{
			var next = mutex.next;
			var prev = mutex.prev;

			if (prev == null) {
				internal_thread.abandoned_mutexs = mutex.next;
			} else {
				prev.next = next;
			}

			if (next != null) {
				next.prev = prev;
			}

			mutex.next = mutex.prev = null;
		}
Beispiel #3
0
		internal void Register (StMutex mutex)
		{
			if ((mutex.next = internal_thread.abandoned_mutexs) != null) {
				internal_thread.abandoned_mutexs.prev = mutex;	
			}
			mutex.prev = null;
			internal_thread.abandoned_mutexs = mutex;
		}