Minor code cleanup

This commit is contained in:
Alex Szpakowski
2014-05-01 14:12:21 -03:00
parent e667485f68
commit e4dc533bb2
26 changed files with 112 additions and 110 deletions
+2 -1
View File
@@ -22,7 +22,7 @@
#define LOVE_THREAD_SDL_THREAD_H
// LOVE
#include <thread/Thread.h>
#include "thread/Thread.h"
#include "threads.h"
// SDL
@@ -34,6 +34,7 @@ namespace thread
{
namespace sdl
{
class Thread : public thread::Thread
{
public:
+6
View File
@@ -27,6 +27,7 @@ namespace thread
{
namespace sdl
{
Mutex::Mutex()
{
mutex = SDL_CreateMutex();
@@ -81,6 +82,11 @@ bool Conditional::wait(thread::Mutex *_mutex, int timeout)
} // sdl
/**
* Implementations of the functions declared in src/modules/threads.h.
**/
thread::Mutex *newMutex()
{
return new sdl::Mutex();
+11 -4
View File
@@ -21,8 +21,8 @@
#ifndef LOVE_THREAD_SDL_THREADS_H
#define LOVE_THREAD_SDL_THREADS_H
#include <common/config.h>
#include <thread/threads.h>
#include "common/config.h"
#include "thread/threads.h"
#include <SDL_thread.h>
@@ -32,11 +32,13 @@ namespace thread
{
namespace sdl
{
class Conditional;
class Mutex : public thread::Mutex
{
public:
Mutex();
~Mutex();
@@ -44,15 +46,18 @@ public:
void unlock();
private:
SDL_mutex *mutex;
Mutex(const Mutex&/* mutex*/) {}
friend class Conditional;
};
}; // Mutex
class Conditional : public thread::Conditional
{
public:
Conditional();
~Conditional();
@@ -61,8 +66,10 @@ public:
bool wait(thread::Mutex *mutex, int timeout=-1);
private:
SDL_cond *cond;
};
}; // Conditional
} // sdl
} // thread