// Post a work item and wait for it to be processed.
        // The processing of the item is done on the client thread
        internal bool PostSyncWorkItem (QueueItem workItem)
        {
            QueueItem.SyncQueueItem syncItem = new QueueItem.SyncQueueItem (workItem);

            // save the data
            _q.Enqueue (syncItem);

            // Start the processing on a different thread
            _ev.Set ();

            // Wait for the processing to be completed
            return syncItem._ev.WaitOne (2000, false);
        }
Пример #2
0
        // Post a work item and wait for it to be processed.
        // The processing of the item is done on the client thread
        internal bool PostSyncWorkItem(QueueItem workItem)
        {
            QueueItem.SyncQueueItem syncItem = new QueueItem.SyncQueueItem(workItem);

            // save the data
            _q.Enqueue(syncItem);

            // Start the processing on a different thread
            _ev.Set();

            // Wait for the processing to be completed
            return(syncItem._ev.WaitOne(2000, false));
        }