JThread();
virtual ~JThread();
int Start();
+ void Stop();
int Kill();
virtual void *Thread() = 0;
bool IsRunning();
+ bool StopRequested();
void *GetReturnValue();
bool IsSameThread();
+
+ /*
+ * Wait for thread to finish
+ * Note: this does not stop a thread you have to do this on your own
+ * WARNING: never ever call this on a thread not started or already killed!
+ */
+ void Wait();
protected:
void ThreadStarted();
private:
HANDLE threadhandle;
#else // pthread type threads
static void *TheThread(void *param);
-
+
pthread_t threadid;
+
+ bool started;
#endif // WIN32
void *retval;
bool running;
-
+ bool requeststop;
+
JMutex runningmutex;
JMutex continuemutex,continuemutex2;
- bool mutexinit;
};
#endif // JTHREAD_H