JeVois  1.5
JeVois Smart Embedded Machine Vision Toolkit
Share this page:
jevois::timed_lock_guard Class Reference

#include <jevois/Debug/Log.H>

Acquire a lock object on a std::timed_mutex, or LFATAL after 1 second of waiting.

Use this as you would use lock_guard (but make sure your mutex is std::timed_mutex). It will throw in case of deadlock, useful for debugging. Users would typically use the JEVOIS_TIMED_LOCK(mtx) macro rather than this class directly.

Definition at line 279 of file Log.H.

Public Member Functions

 timed_lock_guard (std::timed_mutex &mtx, char const *file, char const *func)
 Constructor, locks the mutex or throw if it cannot be locked before timeout. More...
 
 ~timed_lock_guard ()
 Destructor, unlocks the mutex. More...
 

Constructor & Destructor Documentation

◆ timed_lock_guard()

jevois::timed_lock_guard::timed_lock_guard ( std::timed_mutex &  mtx,
char const *  file,
char const *  func 
)
explicit

Constructor, locks the mutex or throw if it cannot be locked before timeout.

Definition at line 289 of file Log.C.

◆ ~timed_lock_guard()

jevois::timed_lock_guard::~timed_lock_guard ( )

Destructor, unlocks the mutex.

Definition at line 300 of file Log.C.


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