-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcv.h
34 lines (27 loc) · 908 Bytes
/
cv.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef _CV_H
#define _CV_H
#include "mutex.h"
class cv {
public:
cv();
~cv();
void wait(mutex&); // wait on this condition variable
void signal(); // wake up one thread on this condition
// variable
void broadcast(); // wake up all threads on this condition
// variable
class impl; // defined by the thread library
impl* impl_ptr; // used by the thread library
/*
* Disable the copy constructor and copy assignment operator.
*/
cv(const cv&) = delete;
cv& operator=(const cv&) = delete;
/*
* Move constructor and move assignment operator. Implementing these is
* optional in Project 2.
*/
cv(cv&&);
cv& operator=(cv&&);
};
#endif /* _CV_H */