protected async Task SetStatus(WorkerStatus status) { try { await WorkStatusSemaphore.WaitAsync(); Status = status; } finally { WorkStatusSemaphore.Release(); } }
public async Task <WorkerStatus> GetStatus() { try { await WorkStatusSemaphore.WaitAsync(); return(Status); } finally { WorkStatusSemaphore.Release(); } }