求助!!!将C++代码用C#的语法表示

怎样把这段C++代码转成C#代码

    std::mutex mutexCompletedCount;
    std::condition_variable conditionCompletedCount;
    auto completedCount = 0;

    auto onCompleted = [&](bool status)
    {
        {
            std::unique_lock<std::mutex> lock(mutexCompletedCount);
            completedCount += 1;
        }
        conditionCompletedCount.notify_one();
    };

1个回答

static object locker = new object(); 
var completedCount = 0;

//...
{
    //获取锁
    Monitor.Enter(locker);
    completedCount++;

    //释放锁
    Monitor.Exit(locker);
}
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问