NebulaStream  0.6.213
NebulaStream is a data and application management framework for the internet of things
NES::Util::FileMutex Class Reference

This is a mutex that uses files to perform locking. It implements the Mutex named requirements. More...

#include <FileMutex.hpp>

Public Member Functions

 FileMutex (const std::string filePath)
 Creates a FileMutex using a file specified as filePath. More...
 
 ~FileMutex ()
 closes the internal file but does not release the mutex. The behavior is undefined if the mutex is owned by any thread or if any thread terminates while holding any ownership of the mutex. More...
 
 FileMutex (const FileMutex &)=delete
 
 FileMutex (FileMutex &&)=delete
 
FileMutexoperator= (const FileMutex &)=delete
 
FileMutexoperator= (FileMutex &&)=delete
 
void lock ()
 lock the mutex More...
 
bool try_lock ()
 try locking the mutex More...
 
void unlock ()
 try unlocking the file More...
 

Detailed Description

This is a mutex that uses files to perform locking. It implements the Mutex named requirements.

Constructor & Destructor Documentation

◆ FileMutex() [1/3]

NES::Util::FileMutex::FileMutex ( const std::string  filePath)
explicit

Creates a FileMutex using a file specified as filePath.

Parameters
filePaththat path to a file

References NES_ASSERT2_FMT.

◆ ~FileMutex()

NES::Util::FileMutex::~FileMutex ( )

closes the internal file but does not release the mutex. The behavior is undefined if the mutex is owned by any thread or if any thread terminates while holding any ownership of the mutex.

◆ FileMutex() [2/3]

NES::Util::FileMutex::FileMutex ( const FileMutex )
delete

◆ FileMutex() [3/3]

NES::Util::FileMutex::FileMutex ( FileMutex &&  )
delete

Member Function Documentation

◆ lock()

void NES::Util::FileMutex::lock ( )

lock the mutex

References fd, and NES_ASSERT.

Referenced by try_lock(), and unlock().

Here is the caller graph for this function:

◆ operator=() [1/2]

FileMutex& NES::Util::FileMutex::operator= ( const FileMutex )
delete

◆ operator=() [2/2]

FileMutex& NES::Util::FileMutex::operator= ( FileMutex &&  )
delete

◆ try_lock()

bool NES::Util::FileMutex::try_lock ( )

try locking the mutex

Returns
true if locking is successful

References fd, and lock().

Here is the call graph for this function:

◆ unlock()

void NES::Util::FileMutex::unlock ( )

try unlocking the file

References fd, lock(), and NES_ASSERT.

Here is the call graph for this function:

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