Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
fc::simple_lock_file Class Reference

#include <filesystem.hpp>

Public Member Functions

 simple_lock_file (const path &lock_file_path)
 
 ~simple_lock_file ()
 
bool try_lock ()
 
void unlock ()
 

Detailed Description

simple class which only allows one process to open any given file. approximate usage: int main() { fc::simple_file_lock instance_lock("~/.my_app/.lock"); if (!instance_lock.try_lock()) { elog("my_app is already running"); return 1; } // do stuff here, file will be unlocked when instance_lock goes out of scope }

Definition at line 250 of file filesystem.hpp.

Constructor & Destructor Documentation

◆ simple_lock_file()

fc::simple_lock_file::simple_lock_file ( const path & lock_file_path)

◆ ~simple_lock_file()

fc::simple_lock_file::~simple_lock_file ( )

Member Function Documentation

◆ try_lock()

bool fc::simple_lock_file::try_lock ( )

◆ unlock()

void fc::simple_lock_file::unlock ( )

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