Merge default into minor

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2016-10-08 11:03:37 -03:00
6 changed files with 16 additions and 12 deletions
+1 -1
View File
@@ -131,7 +131,7 @@ private:
public:
PoolThread(Pool *pool);
~PoolThread();
virtual ~PoolThread();
void setFinish();
void threadFunction();
};
-3
View File
@@ -43,7 +43,6 @@ LuaThread::~LuaThread()
void LuaThread::threadFunction()
{
this->retain();
error.clear();
lua_State *L = luaL_newstate();
@@ -83,8 +82,6 @@ void LuaThread::threadFunction()
if (!error.empty())
onError();
this->release();
}
bool LuaThread::start(const std::vector<Variant> &args)
+2 -2
View File
@@ -36,12 +36,12 @@ namespace love
namespace thread
{
class LuaThread : public love::Object, public Threadable
class LuaThread : public Threadable
{
public:
LuaThread(const std::string &name, love::Data *code);
~LuaThread();
virtual ~LuaThread();
void threadFunction();
const std::string &getError() const;
+10 -3
View File
@@ -29,7 +29,7 @@ namespace sdl
Thread::Thread(Threadable *t)
: t(t)
, running(false)
, thread(0)
, thread(nullptr)
{
}
@@ -74,9 +74,16 @@ bool Thread::isRunning()
int Thread::thread_runner(void *data)
{
Thread *self = (Thread *) data; // some compilers don't like 'this'
self->t->retain();
self->t->threadFunction();
Lock l(self->mutex);
self->running = false;
{
Lock l(self->mutex);
self->running = false;
}
self->t->release();
return 0;
}
} // sdl
+1 -1
View File
@@ -76,7 +76,7 @@ private:
Mutex *mutex;
};
class Threadable
class Threadable : public love::Object
{
public:
Threadable();
+2 -2
View File
@@ -43,7 +43,7 @@ class Video : public love::video::Video
{
public:
Video();
~Video();
virtual ~Video();
// Implements Module
virtual const char *getName() const;
@@ -58,7 +58,7 @@ class Worker : public love::thread::Threadable
{
public:
Worker();
~Worker();
virtual ~Worker();
// Implements Threadable
void threadFunction();