ucommon  7.0.0
About: GNU uCommon C++ is a portable and optimized class framework for writing C++ applications that need to use threads and support concurrent synchronization, and that use sockets, XML parsing, object serialization, thread-optimized string and data structure classes, etc..
  Fossies Dox: ucommon-7.0.0.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

thread.h File Reference
#include <ucommon/cpr.h>
#include <ucommon/access.h>
#include <ucommon/timers.h>
#include <ucommon/memory.h>
#include <ucommon/condition.h>
Include dependency graph for thread.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


class  ucommon::RWLock
class  ucommon::RWLock::reader
class  ucommon::RWLock::writer
class  ucommon::TimedEvent
class  ucommon::RecursiveMutex
class  ucommon::ReusableAllocator
class  ucommon::Mutex
class  ucommon::AutoProtect
class  ucommon::autoprotect< T >
class  ucommon::Thread
class  ucommon::Thread::Local
class  ucommon::JoinableThread
class  ucommon::DetachedThread




#define __AUTOLOCK(x)   autolock __autolock__(x)
#define __AUTOPROTECT(x)   AutoProtect __autolock__(x)
#define __SYNC(x)   for(bool _sync_flag_ = Mutex::protect(x); _sync_flag_; _sync_flag_ = !Mutex::release(x))


typedef TimedEvent ucommon::timedevent_t
typedef Mutex ucommon::mutex_t
typedef RWLock ucommon::rwlock_t
typedef RecursiveMutex ucommon::rexlock_t

Detailed Description

Thread classes and sychronization objects. The theory behind ucommon thread classes is that they would be used to create derived classes where thread-specific data can be stored as member data of the derived class. The run method is called when the context is executed. Since we use a pthread foundation, we support both detached threads and joinable threads. Objects based on detached threads should be created with new, and will automatically delete when the thread context exits. Joinable threads will be joined with deleted.

Definition in file thread.h.

Macro Definition Documentation


#define __AUTOLOCK (   x)    autolock __autolock__(x)

Definition at line 952 of file thread.h.


#define __AUTOPROTECT (   x)    AutoProtect __autolock__(x)

Definition at line 953 of file thread.h.

◆ __SYNC

#define __SYNC (   x)    for(bool _sync_flag_ = Mutex::protect(x); _sync_flag_; _sync_flag_ = !Mutex::release(x))

Definition at line 954 of file thread.h.