Multiple thread backends.

This commit is contained in:
Przemysław Grzywacz
2011-06-08 16:54:35 +02:00
parent 09ed781f66
commit 1d5fca6f46
22 changed files with 1208 additions and 132 deletions
+21 -7
View File
@@ -37,6 +37,7 @@
#include "Source.h"
#include "Pool.h"
#include <thread/threads.h>
// OpenAL
#ifdef LOVE_MACOSX
@@ -66,17 +67,30 @@ namespace openal
// The OpenAL context.
ALCcontext * context;
SDL_Thread * thread;
// The Pool.
Pool * pool;
// Set this to true when the thread should finish.
// Main thread will write to this value, and Audio::run
// will read from it.
bool finish;
static int run(void * unused);
class PoolThread: public thread::ThreadBase {
protected:
Pool* pool;
// Set this to true when the thread should finish.
// Main thread will write to this value, and PoolThread
// will read from it.
volatile bool finish;
// finish lock
thread::Mutex mutex;
virtual void main();
public:
PoolThread(Pool* pool);
void setFinish();
};
PoolThread* poolThread;
public: