25 #include <pspthreadman.h> 26 #include "common/mutex.h" 32 virtual void threadFunction() = 0;
36 static int __threadCallback(SceSize,
void *__this);
37 bool threadCreateAndStart(
const char *threadName,
int priority,
int stackSize,
bool useVfpu =
false);
44 static void delayMillis(uint32 ms);
45 static void delayMicros(uint32 us);
54 bool take() {
return takeWithTimeOut(0); }
55 bool takeWithTimeOut(uint32 timeOut);
57 bool pollForValue(
int value);
58 int numOfWaitingThreads();
68 PspMutex(
bool initialValue) : _semaphore(initialValue ? 1 : 0, 255), _recursiveCount(0), _ownerId(0) {}
71 bool poll() {
return _semaphore.pollForValue(1); }
72 int numOfWaitingThreads() {
return _semaphore.numOfWaitingThreads(); }
73 bool getValue() {
return (
bool)_semaphore.getValue(); }
84 PspCondition() : _mutex(
true), _waitingThreads(0), _signaledThreads(0),
85 _waitSem(0), _doneSem(0) {}
91 PRIORITY_MAIN_THREAD = 36,
92 PRIORITY_TIMER_THREAD = 30,
93 PRIORITY_AUDIO_THREAD = 25,
94 PRIORITY_POWER_THREAD = 20,
95 PRIORITY_DISPLAY_THREAD = 17
99 STACK_DEFAULT = 4 * 1024,
100 STACK_AUDIO_THREAD = 16 * 1024,
101 STACK_TIMER_THREAD = 32 * 1024,
102 STACK_DISPLAY_THREAD = 2 * 1024,
103 STACK_POWER_THREAD = 4 * 1024