예제 #1
0
        protected async Task SetStatus(WorkerStatus status)
        {
            try
            {
                await WorkStatusSemaphore.WaitAsync();

                Status = status;
            }
            finally
            {
                WorkStatusSemaphore.Release();
            }
        }
예제 #2
0
        public async Task <WorkerStatus> GetStatus()
        {
            try
            {
                await WorkStatusSemaphore.WaitAsync();

                return(Status);
            }
            finally
            {
                WorkStatusSemaphore.Release();
            }
        }