#include <iostream>
#include <thread>
#include <mutex>
#ifdef _WIN32
#include <windows.h>
#elif defined(UNIX)
#include <unistd.h>
#endif
using namespace std;
int d = 2;
mutex mt1, mt2;
交叉锁死锁
最新推荐文章于 2023-07-17 21:12:01 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)
#include <iostream>
#include <thread>
#include <mutex>
#ifdef _WIN32
#include <windows.h>
#elif defined(UNIX)
#include <unistd.h>
#endif
using namespace std;
int d = 2;
mutex mt1, mt2;