X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.0%2Flibzmpeg3%2Fthread.h;fp=cinelerra-5.0%2Flibzmpeg3%2Fthread.h;h=0000000000000000000000000000000000000000;hb=30bdb85eb33a8ee7ba675038a86c6be59c43d7bd;hp=71b6efefdaa4087003b66b4b1fe1a7c07c2abc98;hpb=52fcc46226f9df46f9ce9d0566dc568455a7db0b;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.0/libzmpeg3/thread.h b/cinelerra-5.0/libzmpeg3/thread.h deleted file mode 100644 index 71b6efef..00000000 --- a/cinelerra-5.0/libzmpeg3/thread.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef _included_thread -#define _included_thread - -#ifdef TCL_THREADS -#include -#define ThreadId Tcl_ThreadId -#define tMutex Tcl_Mutex -#define mutexInit(m) m = NULL -#define mutexDestroy(m) Tcl_MutexFinalize(&m) -#define mutexLock(m) (Tcl_MutexLock(&m), 0) -#define mutexUnlock(m) (Tcl_MutexUnlock(&m), 0) -#define threadCreate(p,fn,dt) Tcl_CreateThread(&p,v##fn,dt,TCL_THREAD_STACK_DEFAULT,0) -#define threadKill(p) -#else -#include -#define ThreadId pthread_t -#define tMutex pthread_mutex_t -#define mutexInit(m) pthread_mutex_init(&m,0) -#define mutexDestroy(m) pthread_mutex_destroy(&m) -#define mutexLock(m) pthread_mutex_lock(&m) -#define mutexUnlock(m) pthread_mutex_unlock(&m) -#define threadCreate(p,fn,dt) pthread_create(&p,0,fn,dt) -#define threadKill(p) pthread_kill(p,SIGQUIT) -#endif - -class Thread -{ -private: - bool running; - ThreadId p; - tMutex mutex; - static void *ThreadProc (void *); - friend void vThreadProc (void *param) { ThreadProc(param); } -public: Thread ():running (false) - { - mutexInit(mutex); - } - virtual ~ Thread () - { - Kill (); - mutexDestroy(mutex); - } - void Run (); - void PostKill () - { - running = false; - } - void Kill (); - void Kill1(); - bool Running () - { - return running; - } - virtual void Proc () = 0; - void Lock() { mutexLock(mutex); } - void Unlock() { mutexUnlock(mutex); } -}; - -#endif /* */