Beispiel #1
0
            /// <summary>
            /// Queue the notification on the thread.
            /// </summary>
            ///
            public void Queue(Object[] list)
            {
                lock (this) {
                    ILOG.J2CsMapping.Collections.Generics.Collections.Add(queue, list);

                    ThreadUtil.Notify(this);
                }
            }
Beispiel #2
0
        /// <summary>
        /// <p>
        /// Release the write lock and return. An error will be thrown if the write
        /// lock is not currently held.
        /// </p>
        /// <p>
        /// If there are waiting readers, make them all active and notify all of
        /// them. Otherwise, notify the oldest waiting writer, if any. Call when
        /// finished with work controlled by acquireWrite.
        /// </p>
        /// </summary>
        ///
        public void ReleaseWrite()
        {
            switch (FinishWrite())
            {
            case NOTIFY_WRITERS:
                lock (writeLock) {
                    ThreadUtil.Notify(writeLock);
                }
                break;

            case NOTIFY_READERS:
                lock (readLock) {
                    ILOG.J2CsMapping.Threading.ThreadUtil.NotifyAll(readLock);
                }
                break;

            case NOTIFY_NONE:
                break;
            }
        }