My Project: dynamics.mod/NewtonDynamics/source/core/dgAsyncThread.h Source File

My Project

dgAsyncThread.h
Go to the documentation of this file.
1 /* Copyright (c) <2003-2011> <Julio Jerez, Newton Game Dynamics>
2 *
3 * This software is provided 'as-is', without any express or implied
4 * warranty. In no event will the authors be held liable for any damages
5 * arising from the use of this software.
6 *
7 * Permission is granted to anyone to use this software for any purpose,
8 * including commercial applications, and to alter it and redistribute it
9 * freely, subject to the following restrictions:
10 *
11 * 1. The origin of this software must not be misrepresented; you must not
12 * claim that you wrote the original software. If you use this software
13 * in a product, an acknowledgment in the product documentation would be
14 * appreciated but is not required.
15 *
16 * 2. Altered source versions must be plainly marked as such, and must not be
17 * misrepresented as being the original software.
18 *
19 * 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 #ifndef __DG_ASYNC_THREAD_H__
23 #define __DG_ASYNC_THREAD_H__
24
25 #include "dgTypes.h"
26 #include "dgThread.h"
27
28 class dgAsyncThread: public dgThread
29 {
30 public:
31 dgAsyncThread(const char* const name, dgInt32 id);
32 virtual ~dgAsyncThread(void);
33
34 void Tick();
35 void Terminate();
36
37 protected:
38 virtual void Execute (dgInt32 threadID);
39 virtual void TickCallback (dgInt32 threadID) = 0;
40
41 private:
42 // dgInt32 m_terminate;
43 dgSemaphore m_myMutex;
44 dgSemaphore m_callerMutex;
45 };
46
47 #endif
dgAsyncThread::dgAsyncThread
dgAsyncThread(const char *const name, dgInt32 id)
Definition: dgAsyncThread.cpp:27
dgAsyncThread::TickCallback
virtual void TickCallback(dgInt32 threadID)=0
dgInt32
int dgInt32
Definition: dgTypes.h:218
dgThread
Definition: dgThread.h:32
dgAsyncThread::~dgAsyncThread
virtual ~dgAsyncThread(void)
Definition: dgAsyncThread.cpp:35
dgAsyncThread::Tick
void Tick()
Definition: dgAsyncThread.cpp:63
dgAsyncThread
Definition: dgAsyncThread.h:28
dgAsyncThread::Execute
virtual void Execute(dgInt32 threadID)
Definition: dgAsyncThread.cpp:51
dgAsyncThread::Terminate
void Terminate()
Definition: dgAsyncThread.cpp:41
dgThread::dgSemaphore
Definition: dgThread.h:51
dgThread.h
dgTypes.h