public void SetOne() { // Interlocked 原子操作类 ,此处将计数器减1 if (Interlocked.Decrement(ref _current) == 0) { //当所以等待线程执行完毕时,唤醒等待的线程 _done.Set(); } }