projects
/
physics.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added DASSERT
[physics.git]
/
src
/
debug.cpp
diff --git
a/src/debug.cpp
b/src/debug.cpp
index
909a54f
..
4e659d2
100644
(file)
--- a/
src/debug.cpp
+++ b/
src/debug.cpp
@@
-22,31
+22,35
@@
using std::cerr;
using std::cout;
using std::endl;
using std::cout;
using std::endl;
-#include <SDL/SDL.h>
+#include <assert.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.clean();
+}
+
+void DASSERT(bool fBreak)
+{
+ assert(fBreak);
}
/// ***** Private Methods *****
}
/// ***** Private Methods *****