From cfa7bc748a224f200bb52cd7dd904940ff26a7f1 Mon Sep 17 00:00:00 2001 From: "wrenczes@gmail.com" Date: Tue, 1 Feb 2011 05:58:19 +0000 Subject: [PATCH] More logging calls to my threading header. --- projects/mtg/include/Threading.h | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/projects/mtg/include/Threading.h b/projects/mtg/include/Threading.h index f9f2a49b7..35249f63b 100644 --- a/projects/mtg/include/Threading.h +++ b/projects/mtg/include/Threading.h @@ -9,6 +9,8 @@ #else #include "pspthreadman.h" +#include "JLogger.h" + namespace boost { @@ -17,15 +19,24 @@ namespace boost public: struct scoped_lock { - scoped_lock(mutex& inMutex) : - mID(inMutex.mID) + scoped_lock(mutex& inMutex) : mID(inMutex.mID) { - sceKernelWaitSema(mID, 1, 0); + int result = sceKernelWaitSema(mID, 1, 0); + if (result < 0) + { + LOG("Semaphore error on lock acquire, mutex id: "); + LOG((char*)mID); + } } ~scoped_lock() { - sceKernelSignalSema(mID, 1); + int result = sceKernelSignalSema(mID, 1); + if (result < 0) + { + LOG("Semaphore error on lock release, mutex id: "); + LOG((char*)mID); + } } int mID; @@ -48,4 +59,4 @@ namespace boost #endif -#endif // THREADING_H +#endif // THREADING_H \ No newline at end of file