Class Buzzer
Placement in the overall structure
- Module
- meeting
- Base classes
- Waitingroom
- Bell
- Derived classes
- Guarded_Buzzer
- Time of creation
- Task 6
- Files
buzzer.handbuzzer.cc
Description
An "alarm clock" is a synchronization object that allows one or more threads to put themselves to sleep for a specified time.
Public methods
Buzzer ()- In the constructor, the alarm clock is initially switched off.
virtual ~Buzzer()- In the destructor, the Bellringer is informed that he no longer needs to ring. Furthermore, all waiting threads are woken up.
virtual void ring()- Called by the Bellringer when the waiting time has expired. Wakes up sleeping threads if necessary.
void set (int ms)- Setting the alarm clock.
void sleep ()- Sleep until the alarm clock rings.