More logging calls to my threading header.

This commit is contained in:
wrenczes@gmail.com
2011-02-01 05:58:19 +00:00
parent 9085b2a0e1
commit cfa7bc748a

View File

@@ -9,6 +9,8 @@
#else #else
#include "pspthreadman.h" #include "pspthreadman.h"
#include "JLogger.h"
namespace boost namespace boost
{ {
@@ -17,15 +19,24 @@ namespace boost
public: public:
struct scoped_lock struct scoped_lock
{ {
scoped_lock(mutex& inMutex) : scoped_lock(mutex& inMutex) : mID(inMutex.mID)
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() ~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; int mID;
@@ -48,4 +59,4 @@ namespace boost
#endif #endif
#endif // THREADING_H #endif // THREADING_H