Motion Master 6.0.0-alpha.111
Next-generation motion control software
Loading...
Searching...
No Matches
mm::comm::BusLock Class Reference

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 ()
 

Detailed Description

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.

Member Function Documentation

◆ lock()

void mm::comm::BusLock::lock ( )

◆ lock_shared()

void mm::comm::BusLock::lock_shared ( )

◆ unlock()

void mm::comm::BusLock::unlock ( )

◆ unlock_shared()

void mm::comm::BusLock::unlock_shared ( )

The documentation for this class was generated from the following files: