File addition for my threading work. This has no impact on the build until I tie in my other changes.

This commit is contained in:
wrenczes@gmail.com
2010-11-26 19:41:15 +00:00
parent 5bb435d525
commit 75345469ee

View File

@@ -0,0 +1,51 @@
#ifndef THREADING_H
#define THREADING_H
#if defined (WIN32) || defined (LINUX)
#include <boost/date_time.hpp>
#include <boost/thread.hpp>
#else
#include "pspthreadman.h"
namespace boost
{
class mutex
{
public:
struct scoped_lock
{
scoped_lock(mutex& inMutex) : mID(inMutex.mID)
{
sceKernelWaitSema(mID, 1, 0);
}
~scoped_lock()
{
sceKernelSignalSema(mID, 1);
}
int mID;
};
mutex()
{
mID = sceKernelCreateSema("Unnamed", 0, 1, 1, 0);
}
~mutex()
{
sceKernelDeleteSema(mID);
}
int mID;
};
}
#endif
#endif // THREADING_H