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:
51
projects/mtg/include/Threading.h
Normal file
51
projects/mtg/include/Threading.h
Normal 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
|
||||
Reference in New Issue
Block a user