C 98 Mutex中共享数组的锁定变量

Locking variables for shared array in C++98 mutex

本文关键字:锁定 变量 数组 共享 Mutex      更新时间:2023-10-16

我是Mutex想法的新手,但是需要在两个过程之间进行共享数组的锁定控制。

我发现的唯一的C 教程对我来说是有意义的,以了解Mutex实现的使用显示#include <mutex>的使用,这将失败给出错误:/usr/include/c++/4.6/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This support is currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options.有没有办法在任何一个简单的可读取的非2011-标准c中进行此操作或C ?

C 在2011年之前既没有任何多线程的概念。在C11或C 11。

之前