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