CernVM-FS  2.12.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Fence Class Reference

#include <fence.h>

Inheritance diagram for Fence:
Collaboration diagram for Fence:

Public Member Functions

 Fence ()
 
void Enter ()
 
void Leave ()
 
void Close ()
 
void Drain ()
 
void Open ()
 

Private Member Functions

 FRIEND_TEST (T_Fence, Basics)
 

Private Attributes

atomic_int64 counter_
 
atomic_int32 blocking_
 

Static Private Attributes

static const unsigned kBusyWaitBackoffMs = 100
 

Additional Inherited Members

- Protected Member Functions inherited from SingleCopy
 SingleCopy ()
 

Detailed Description

This file is part of the CernVM File System. A Fence can be used to protect critical regions where blocking is a very rare operation. When the Fence is not blocked, entering and leaving a critical region requires only a 1-2 atomic operations. In order to block the fence, no new threads can enter a critical region. When all entered regions are left, the fence is blocked. Waiting is done through slow busy wait.

Definition at line 25 of file fence.h.

Constructor & Destructor Documentation

Fence::Fence ( )
inline

Definition at line 29 of file fence.h.

Member Function Documentation

void Fence::Close ( )
inline

Definition at line 45 of file fence.h.

Referenced by loader::Reload().

Here is the caller graph for this function:

void Fence::Drain ( )
inline

Close and let live critical regions exit

Definition at line 52 of file fence.h.

Referenced by loader::Reload(), and FuseRemounter::TryFinish().

Here is the call graph for this function:

Here is the caller graph for this function:

void Fence::Enter ( )
inline

Definition at line 34 of file fence.h.

Referenced by cvmfs::cvmfs_forget(), cvmfs::cvmfs_getattr(), cvmfs::cvmfs_getxattr(), cvmfs::cvmfs_listxattr(), cvmfs::cvmfs_lookup(), cvmfs::cvmfs_open(), cvmfs::cvmfs_opendir(), cvmfs::cvmfs_readlink(), cvmfs::cvmfs_statfs(), cvmfs::Evict(), and cvmfs::Pin().

Here is the call graph for this function:

Here is the caller graph for this function:

Fence::FRIEND_TEST ( T_Fence  ,
Basics   
)
private
void Fence::Open ( )
inline

Definition at line 59 of file fence.h.

Referenced by loader::Reload(), and FuseRemounter::TryFinish().

Here is the caller graph for this function:

Member Data Documentation

atomic_int32 Fence::blocking_
private

A boolean that indicates if the fence is blocked.

Definition at line 74 of file fence.h.

atomic_int64 Fence::counter_
private

Number of active critical regions.

Definition at line 69 of file fence.h.

const unsigned Fence::kBusyWaitBackoffMs = 100
staticprivate

Definition at line 64 of file fence.h.


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