This is Unofficial EPICS BASE Doxygen Site
boost::detail::spinlock Class Reference

#include "spinlock_pt.hpp"

Classes

class  scoped_lock
 

Public Member Functions

bool try_lock ()
 
void lock ()
 
void unlock ()
 
bool try_lock ()
 
void lock ()
 
void unlock ()
 

Public Attributes

pthread_mutex_t v_
 
int v_
 

Detailed Description

Definition at line 26 of file spinlock_pt.hpp.

Member Function Documentation

void boost::detail::spinlock::lock ( )
inline

Definition at line 39 of file spinlock_pt.hpp.

40  {
41  pthread_mutex_lock( &v_ );
42  }
pthread_mutex_t v_
Definition: spinlock_pt.hpp:30
void boost::detail::spinlock::lock ( )
inline

Definition at line 44 of file spinlock_sync.hpp.

45  {
46  for( unsigned k = 0; !try_lock(); ++k )
47  {
49  }
50  }
void yield(unsigned)
Definition: yield_k.hpp:139
bool boost::detail::spinlock::try_lock ( )
inline

Definition at line 34 of file spinlock_pt.hpp.

35  {
36  return pthread_mutex_trylock( &v_ ) == 0;
37  }
pthread_mutex_t v_
Definition: spinlock_pt.hpp:30
bool boost::detail::spinlock::try_lock ( )
inline

Definition at line 38 of file spinlock_sync.hpp.

39  {
40  int r = __sync_lock_test_and_set( &v_, 1 );
41  return r == 0;
42  }
pthread_mutex_t v_
Definition: spinlock_pt.hpp:30
void boost::detail::spinlock::unlock ( )
inline

Definition at line 44 of file spinlock_pt.hpp.

45  {
46  pthread_mutex_unlock( &v_ );
47  }
pthread_mutex_t v_
Definition: spinlock_pt.hpp:30
void boost::detail::spinlock::unlock ( )
inline

Definition at line 52 of file spinlock_sync.hpp.

53  {
54  __sync_lock_release( &v_ );
55  }
pthread_mutex_t v_
Definition: spinlock_pt.hpp:30

Member Data Documentation

pthread_mutex_t boost::detail::spinlock::v_

Definition at line 30 of file spinlock_pt.hpp.

int boost::detail::spinlock::v_

Definition at line 34 of file spinlock_sync.hpp.


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