libcrn  3.9.5
A document image processing library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Static Public Member Functions | List of all members
crn::FileShield Class Reference

A mutex manager for file access. More...

#include <CRNFileShield.h>

Static Public Member Functions

static std::mutex & GetMutex (const Path &fname)
 Gets the mutex associated to a file. More...
 

Detailed Description

A mutex manager for file access.

A mutex manager for file access.

Usage: place the following line at the beginning of the block you want to protect

std::lock_guard<std::mutex> lock(crn::FileShield::GetMutex("/path/to/file"));
Author
Yann LEYDIER
Date
26 Jan 2011
Version
0.1

Definition at line 46 of file CRNFileShield.h.

Member Function Documentation

std::mutex & FileShield::GetMutex ( const Path fname)
static

Gets the mutex associated to a file.

Gets the mutex associated to a file

Parameters
[in]fnamethe file to shield
Returns
a reference to the mutex associated to the file

Definition at line 44 of file CRNFileShield.cpp.


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