|
Motion Master 6.0.0-alpha.111
Next-generation motion control software
|
A reader/writer lock that lets no new reader in while a writer waits. More...
#include <control_plane_locks.h>
Public Member Functions | |
| void | lock () |
| void | unlock () |
| void | lock_shared () |
| void | unlock_shared () |
A reader/writer lock that lets no new reader in while a writer waits.
A fieldbus driver takes it shared for the work on one drive and exclusive for the work on the whole bus. The shared holders come from several threads: HTTP workers, the monitoring refresher and a procedure. Their holds can overlap with no gap between them. std::shared_mutex on glibc lets a new reader in while a writer waits, so a scan could wait for as long as the overlap lasts. This lock makes a waiting writer stop new readers, so a scan waits only for the holds that already started.
The member names are the ones std::unique_lock and std::shared_lock call.
| void mm::comm::BusLock::lock | ( | ) |
| void mm::comm::BusLock::lock_shared | ( | ) |
| void mm::comm::BusLock::unlock | ( | ) |
| void mm::comm::BusLock::unlock_shared | ( | ) |