projects
/
physics.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
created locks abstraction
[physics.git]
/
src
/
debug.cpp
diff --git
a/src/debug.cpp
b/src/debug.cpp
index
e838c8e
..
5c8baeb
100644
(file)
--- a/
src/debug.cpp
+++ b/
src/debug.cpp
@@
-22,32
+22,28
@@
using std::cerr;
using std::cout;
using std::endl;
using std::cout;
using std::endl;
-#include <SDL/SDL.h>
+#include "locks/Mutex.h"
+#include "locks/Autolock.h"
/// ***** Public Methods *****
/// ***** Public Methods *****
-
SDL_mutex* muDPF = NULL
;
+
Mutex muDPF
;
void DPF(int level, const char* pstr)
{
void DPF(int level, const char* pstr)
{
- // lock
- SDL_mutexP( muDPF );
+ Autolock lock(muDPF);
cout << pstr << endl;
cout << pstr << endl;
-
- //unlock
- SDL_mutexV( muDPF );
}
void debug::init()
{
}
void debug::init()
{
- muDPF
= SDL_CreateMutex
();
+ muDPF
.init
();
}
void debug::clean()
{
}
void debug::clean()
{
- SDL_DestroyMutex( muDPF );
- muDPF = NULL;
+ muDPF.clean();
}
/// ***** Private Methods *****
}
/// ***** Private Methods *****