Esempio n. 1
0
        private void Recycle(FutureBase future)
        {
            lock (_futuresPending)
            {
                _futuresPending.Remove(future);

                if (Log.IsInfoEnabled)
                {
                    Log.Info(
                        ".DispatchFuture - Instance {0} done dispatching: {1} pending",
                        _id,
                        _futuresPending.Count);
                }

                if (_futuresPending.Count == 0)
                {
                    _futuresMonitor.Set();
                }
            }

            Interlocked.Increment(ref _numRecycled);
        }
Esempio n. 2
0
        private void Recycle(FutureBase future)
        {
            Log.Info(".Recycle - Instance {0} starting", _id);
            lock (_futuresPending) {
                using (new Tracer(Log, "Recycle(lock)")) {
                    _futuresPending.Remove(future);

                    if (Log.IsInfoEnabled)
                    {
                        Log.Info(
                            ".Recycle - Instance {0} done dispatching: {1} pending",
                            _id,
                            _futuresPending.Count);
                    }

                    if (_futuresPending.Count == 0)
                    {
                        Monitor.PulseAll(_futuresPending);
                    }
                }
            }

            Interlocked.Increment(ref _numRecycled);
        }