示例#1
0
        public IWaitable <TResult> ScheduleWork <TResult>(Func <TResult> function)
        {
            CheckDisposed();

            var work = new ThreadPoolWork <TResult>(function);

            _worksQueue.Enqueue(work);
            return(work);
        }
示例#2
0
        public IWaitable ScheduleWork(Action action)
        {
            CheckDisposed();

            var work = new ThreadPoolWork(action);

            _worksQueue.Enqueue(work);
            return(work);
        }