mirror of
https://github.com/love2d/love.git
synced 2026-08-17 11:00:31 +02:00
Merge in channels from love-experiments
Rewritten love.thread and changed communication method from weird system before, to channels. --HG-- branch : minor
This commit is contained in:
@@ -23,6 +23,8 @@
|
||||
|
||||
#include "sound/Decoder.h"
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
namespace love
|
||||
{
|
||||
namespace audio
|
||||
@@ -34,9 +36,16 @@ Audio::PoolThread::PoolThread(Pool *pool)
|
||||
: pool(pool)
|
||||
, finish(false)
|
||||
{
|
||||
mutex = thread::newMutex();
|
||||
}
|
||||
|
||||
void Audio::PoolThread::main()
|
||||
Audio::PoolThread::~PoolThread()
|
||||
{
|
||||
delete mutex;
|
||||
}
|
||||
|
||||
|
||||
void Audio::PoolThread::threadFunction()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
@@ -59,7 +68,6 @@ void Audio::PoolThread::setFinish()
|
||||
finish = true;
|
||||
}
|
||||
|
||||
|
||||
Audio::Audio() : distanceModel(DISTANCE_INVERSE_CLAMPED)
|
||||
{
|
||||
// Passing zero for default device.
|
||||
|
||||
Reference in New Issue
Block a user