fix8  version 1.4.0
Open Source C++ FIX Framework
FIX8::f8_spin_lock Class Reference

generic spin_lock wrapper More...

#include <thread.hpp>

Public Member Functions

 f8_spin_lock ()
 
 ~f8_spin_lock ()
 
void lock ()
 
bool try_lock ()
 
void unlock ()
 

Private Attributes

pthread_spinlock_t _psl
 

Detailed Description

generic spin_lock wrapper

Definition at line 364 of file thread.hpp.

Constructor & Destructor Documentation

FIX8::f8_spin_lock::f8_spin_lock ( )
inline

Definition at line 369 of file thread.hpp.

370  {
371  if (pthread_spin_init(&_psl, PTHREAD_PROCESS_PRIVATE))
372  throw f8Exception("pthread_spin_init failed");
373  }
pthread_spinlock_t _psl
Definition: thread.hpp:366
FIX8::f8_spin_lock::~f8_spin_lock ( )
inline

Definition at line 375 of file thread.hpp.

375 { pthread_spin_destroy(&_psl); };
pthread_spinlock_t _psl
Definition: thread.hpp:366

Member Function Documentation

void FIX8::f8_spin_lock::lock ( )
inline

Definition at line 377 of file thread.hpp.

377 { pthread_spin_lock(&_psl); }
pthread_spinlock_t _psl
Definition: thread.hpp:366
bool FIX8::f8_spin_lock::try_lock ( )
inline

Definition at line 378 of file thread.hpp.

378 { return pthread_spin_trylock(&_psl) == 0; }
pthread_spinlock_t _psl
Definition: thread.hpp:366
void FIX8::f8_spin_lock::unlock ( )
inline

Definition at line 379 of file thread.hpp.

379 { pthread_spin_unlock(&_psl); }
pthread_spinlock_t _psl
Definition: thread.hpp:366

Member Data Documentation

pthread_spinlock_t FIX8::f8_spin_lock::_psl
private

Definition at line 366 of file thread.hpp.


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