rllib  1
Public Member Functions | Public Attributes | List of all members
rlMutex Class Reference

#include <rlthread.h>

Public Member Functions

 rlMutex (const void *attr=NULL)
 
virtual ~rlMutex ()
 
int trylock ()
 
int lock ()
 
int unlock ()
 

Public Attributes

pthread_mutex_t mutex
 

Detailed Description

Mutex functions based on POSIX threads.

Definition at line 118 of file rlthread.h.

Constructor & Destructor Documentation

◆ rlMutex()

rlMutex::rlMutex ( const void *  attr = NULL)

Definition at line 90 of file rlthread.cpp.

91 {
93 }
int rlwthread_mutex_init(pthread_mutex_t *mptr, const pthread_mutexattr_t *attr)
Definition: rlwthread.cpp:160
pthread_mutex_t mutex
Definition: rlthread.h:142
long pthread_mutexattr_t
Definition: rlwthread.h:72

◆ ~rlMutex()

rlMutex::~rlMutex ( )
virtual

Definition at line 95 of file rlthread.cpp.

96 {
98 }
int rlwthread_mutex_destroy(pthread_mutex_t *mptr)
Definition: rlwthread.cpp:178
pthread_mutex_t mutex
Definition: rlthread.h:142

Member Function Documentation

◆ lock()

int rlMutex::lock ( )
Lock the mutex.

Definition at line 105 of file rlthread.cpp.

106 {
107  return rlwthread_mutex_lock(&mutex);
108 }
int rlwthread_mutex_lock(pthread_mutex_t *mptr)
Definition: rlwthread.cpp:193
pthread_mutex_t mutex
Definition: rlthread.h:142

◆ trylock()

int rlMutex::trylock ( )
Try to lock the mutex.
return 0 if already locked
return !0 if lock sucessfull

Definition at line 100 of file rlthread.cpp.

101 {
103 }
int rlwthread_mutex_trylock(pthread_mutex_t *mptr)
Definition: rlwthread.cpp:215
pthread_mutex_t mutex
Definition: rlthread.h:142

◆ unlock()

int rlMutex::unlock ( )
Unlock the mutex.

Definition at line 110 of file rlthread.cpp.

111 {
112  return rlwthread_mutex_unlock(&mutex);
113 }
pthread_mutex_t mutex
Definition: rlthread.h:142
int rlwthread_mutex_unlock(pthread_mutex_t *mptr)
Definition: rlwthread.cpp:238

Member Data Documentation

◆ mutex

pthread_mutex_t rlMutex::mutex

Definition at line 142 of file rlthread.h.


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