OK, I looked at it again and I was wrong... I haven't touched this for a while.
It is a template class and you can have multiple condition variables. You need to instantiate it in your class from which lock/unlock are accessible.
Giovanni
I see, so that's mean we are supposed to inherit the ...
Search found 3 matches
- Thu Jul 04, 2019 1:25 am
- Forum: Bug Reports
- Topic: Usage of c++ monitor wrapper
- Replies: 4
- Views: 5138
- Wed Jul 03, 2019 5:41 pm
- Forum: Bug Reports
- Topic: Usage of c++ monitor wrapper
- Replies: 4
- Views: 5138
Re: Usage of c++ monitor wrapper
Hi,
Apparently the monitor class is not complete, it should expose its own lock/unlock to outside.
About the condition variable, you don't need more than one, wait for the variable to be signaled then check one or more conditions to be satisfied.
Moving in "bug reports" about the monitor class ...
Apparently the monitor class is not complete, it should expose its own lock/unlock to outside.
About the condition variable, you don't need more than one, wait for the variable to be signaled then check one or more conditions to be satisfied.
Moving in "bug reports" about the monitor class ...
- Wed Jul 03, 2019 5:20 pm
- Forum: Bug Reports
- Topic: Usage of c++ monitor wrapper
- Replies: 4
- Views: 5138
Usage of c++ monitor wrapper
I am confused on how to use the monitor class.
From what I have learnt, a monitor is used to guard data and allow threads to wait for their change, where modification and observation to the data is only done when the mutex is held.
However the monitor class inherited mutex with "protected" making it ...
From what I have learnt, a monitor is used to guard data and allow threads to wait for their change, where modification and observation to the data is only done when the mutex is held.
However the monitor class inherited mutex with "protected" making it ...