X-Git-Url: http://gitweb.pgornicz.com/gitweb.cgi?p=physics.git;a=blobdiff_plain;f=src%2Fdebug.cpp;h=5c8baeb1fe4e130a007a1c706f6d51753cfefcb4;hp=e838c8e1e7dc03cf42d4a795af100875c2600535;hb=3bccd1d78b605dc5b2898877601ad1a6374e0e44;hpb=e616366d12163fd5947cc87433e2dd51746e6846 diff --git a/src/debug.cpp b/src/debug.cpp index e838c8e..5c8baeb 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -22,32 +22,28 @@ using std::cerr; using std::cout; using std::endl; -#include +#include "locks/Mutex.h" +#include "locks/Autolock.h" /// ***** Public Methods ***** -SDL_mutex* muDPF = NULL; +Mutex muDPF; void DPF(int level, const char* pstr) { - // lock - SDL_mutexP( muDPF ); + Autolock lock(muDPF); cout << pstr << endl; - - //unlock - SDL_mutexV( muDPF ); } void debug::init() { - muDPF = SDL_CreateMutex(); + muDPF.init(); } void debug::clean() { - SDL_DestroyMutex( muDPF ); - muDPF = NULL; + muDPF.clean(); } /// ***** Private Methods *****