14 #ifndef __INCLUDED_SCOPIRA_TOOL_THREAD_PTHREADS_H__    15 #define __INCLUDED_SCOPIRA_TOOL_THREAD_PTHREADS_H__    18 #include <QReadWriteLock>    19 #include <QWaitCondition>    21 #include <scopira/tool/platform.h>    22 #include <scopira/tool/export.h>    24 #include <scopira/tool/object.h>    36     typedef void* (*runfunc_t)(
void*);
    53     template <
class T> 
class shared_area;
    54     template <
class T> 
class event_area;
    55     template <
class T> 
class rw_area;
    57     template <
class T> 
class area_ptr;
    58     template <
class T> 
class const_area_ptr;
    59     template <
class T> 
class locker_ptr;
    60     template <
class T> 
class event_ptr;
    61     template <
class T> 
class read_locker_ptr;
    62     template <
class T> 
class write_locker_ptr;
    78     SCOPIRA_EXPORT 
virtual void run(
void) = 0;
    81     virtual ~runnable_i() { }
    93     SCOPIRA_EXPORT 
virtual void start(
void) = 0;
    96     SCOPIRA_EXPORT 
virtual void notify_stop(
void) = 0;
    99     SCOPIRA_EXPORT 
virtual void wait_stop(
void) = 0;
   102     SCOPIRA_EXPORT 
virtual bool is_running(
void) 
const = 0;
   114     typedef int tlskey_t;
   117     runnable_i *dm_target;
   119     void *dm_runfunc_arg;
   126         virtual void run(
void) { dm_parent->run(); }
   155     SCOPIRA_EXPORT thread(
runfunc_t func, 
void *arg);
   158     SCOPIRA_EXPORT 
virtual ~thread();
   161     SCOPIRA_EXPORT 
virtual void run(
void);
   164     SCOPIRA_EXPORT 
virtual void start(
void);
   167     SCOPIRA_EXPORT 
virtual void notify_stop(
void);
   169     SCOPIRA_EXPORT 
virtual void wait_stop(
void);
   171     SCOPIRA_EXPORT 
virtual bool is_running(
void)
 const { 
return dm_thread.isRunning(); }
   179     SCOPIRA_EXPORT 
static void sleep(
int msec);
   190     SCOPIRA_EXPORT 
static void open_tls(tlskey_t &outkey);
   196     SCOPIRA_EXPORT 
static void close_tls(tlskey_t k);
   205     SCOPIRA_EXPORT 
static void set_tls(tlskey_t k, 
void *val);
   213     SCOPIRA_EXPORT 
static void * get_tls(tlskey_t k);
   229     QWaitCondition dm_con;
   237     SCOPIRA_EXPORT ~condition();
   244     SCOPIRA_EXPORT 
void notify(
void);
   250     SCOPIRA_EXPORT 
void notify_all(
void);
   259     SCOPIRA_EXPORT 
void wait(
mutex &mut);
   271     SCOPIRA_EXPORT 
bool wait(
mutex &mut, 
int msec);
   282     QReadWriteLock dm_rw;
   286     SCOPIRA_EXPORT 
rwlock(
void);
   288     SCOPIRA_EXPORT ~rwlock();
   291     SCOPIRA_EXPORT 
void write_lock(
void);
   293     SCOPIRA_EXPORT 
bool try_write_lock(
void);
   295     SCOPIRA_EXPORT 
void read_lock(
void);
   297     SCOPIRA_EXPORT 
bool try_read_lock(
void);
   299     SCOPIRA_EXPORT 
void unlock(
void);
   409     area_ptr(
const volatile T& ref) : dm_ptr(const_cast<T*>(&ref)) { }
   413     T* 
get(void) { 
return dm_ptr; }
   425     void reset(
void) { dm_ptr = 
const_cast<T*
>(
const_cast<volatile T*
>(dm_ptr)); }  
   466     const T* 
get(void) { 
return dm_ptr; }
   478     void reset(
void) { dm_ptr = 
const_cast<const T*
>(
const_cast<volatile T*
>(dm_ptr)); }  
 
Definition: archiveflow.h:20