cAudio  2.3.0
3d Audio Engine
cThread.h
1 // Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
2 // This file is part of the "cAudio Engine"
3 // For conditions of distribution and use, see copyright notice in cAudio.h
4 
5 #pragma once
6 
7 #include "cMutex.h"
8 #include "cAudioDefines.h"
9 #include "IThread.h"
10 
11 #ifdef CAUDIO_PLATFORM_WIN
12 #include <process.h>
13 #else
14 #include <pthread.h> //Assumed linux system
15 #endif
16 
17 namespace cAudio
18 {
19  class cAudioThread : public IThread
20  {
21  public:
22  cAudioThread(IThreadWorker* pWorker);
23  ~cAudioThread();
24 
25  virtual bool start();
26  virtual void join();
27  virtual void shutdown();
28  virtual bool isRunning();
29 
30  protected:
31  void updateLoop();
32 
33 #ifdef CAUDIO_PLATFORM_WIN
34  static unsigned int __stdcall threadFunc(void *args);
35  HANDLE ThreadHandle;
36 #else
37  static void* threadFunc(void* args);
38  pthread_t ThreadHandle;
39 #endif
40  IThreadWorker* Worker;
41  unsigned int ThreadID;
42  cAudioMutex Mutex;
43  bool IsInit;
44  bool Loop;
45  };
46 };
Main namespace for the entire cAudio library.
Definition: cAudioCapture.h:15