我想初始化的c'tor的潮頭鎖,我沒有找到路...C++ /類和線程
class readersWriters{
private:
mutex _mu;
unique_lock<mutex> _locker;
condition_variable _condW;
condition_variable _condR;
int _readersNumber;
int _writersNumber;
std::string _fileName;
public:
readersWriters(std::string fileName);
void readLock();
void writeLock();
void readUnlock();
void writeUnlock();
std::string readLine(int lineNumber); //lineNumber - line number to read
void WriteLine(int lineNumber, std::string newLine);//lineNumber - line number to write
};
感謝您的幫助
我想給你正確的答案,我沒有找到方法... – SergeyA