mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-05-26 23:26:45 -04:00
Remove JASAudioThread race condition fixing code
I'm not planning on using JASAudioThread anymore
This commit is contained in:
@@ -32,11 +32,6 @@ struct JASAudioThread : public JKRThread, public JASGlobalInstance<JASAudioThrea
|
||||
|
||||
static volatile int snIntCount; // type unsure
|
||||
|
||||
#if TARGET_PC
|
||||
static bool sThreadInitComplete;
|
||||
static OSMutex sThreadInitCompleteMutex;
|
||||
static OSCond sThreadInitCompleteCond;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif /* JASAUDIOTHREAD_H */
|
||||
|
||||
@@ -21,17 +21,8 @@ JASAudioThread::JASAudioThread(int stackSize, int msgCount, u32 threadPriority)
|
||||
OSInitThreadQueue(&sThreadQueue);
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
bool JASAudioThread::sThreadInitComplete = false;
|
||||
OSMutex JASAudioThread::sThreadInitCompleteMutex;
|
||||
OSCond JASAudioThread::sThreadInitCompleteCond;
|
||||
#endif
|
||||
|
||||
void JASAudioThread::create(s32 threadPriority) {
|
||||
#if TARGET_PC
|
||||
OSInitMutex(&sThreadInitCompleteMutex);
|
||||
OSInitCond(&sThreadInitCompleteCond);
|
||||
#endif
|
||||
OSPanic(__FILE__, __LINE__, "JASAudioThread does not work on PC!");
|
||||
|
||||
#if PLATFORM_GCN
|
||||
const int size = 0x1400;
|
||||
@@ -79,13 +70,6 @@ void* JASAudioThread::run() {
|
||||
JASPoolAllocObject_MultiThreaded<JASChannel>::newMemPool(0x48);
|
||||
JASDriver::startDMA();
|
||||
|
||||
#if TARGET_PC
|
||||
OSLockMutex(&sThreadInitCompleteMutex);
|
||||
sThreadInitComplete = true;
|
||||
OSUnlockMutex(&sThreadInitCompleteMutex);
|
||||
OSSignalCond(&sThreadInitCompleteCond);
|
||||
#endif
|
||||
|
||||
OSMessage msg;
|
||||
while (true) {
|
||||
msg = waitMessageBlock();
|
||||
|
||||
@@ -106,19 +106,6 @@ void Z2AudioMgr::init(JKRSolidHeap* heap, u32 memSize, void* baaData, JKRArchive
|
||||
JASPoolAllocObject<Z2SoundHandlePool>::newMemPool(0x4e);
|
||||
OS_REPORT("[Z2AudioMgr::init]before Create Section: %d\n", heap->getFreeSize());
|
||||
|
||||
#if TARGET_PC
|
||||
// Fix a race condition with OS threading where JAUNewSectionHeap will use all the remaining
|
||||
// space in the JASDram heap before JASAudioThread has finished initializing.
|
||||
|
||||
OSLockMutex(&JASAudioThread::sThreadInitCompleteMutex);
|
||||
while (!JASAudioThread::sThreadInitComplete) {
|
||||
OSWaitCond(
|
||||
&JASAudioThread::sThreadInitCompleteCond,
|
||||
&JASAudioThread::sThreadInitCompleteMutex);
|
||||
}
|
||||
OSUnlockMutex(&JASAudioThread::sThreadInitCompleteMutex);
|
||||
#endif
|
||||
|
||||
JAUSectionHeap* sectionHeap = JAUNewSectionHeap(true);
|
||||
sectionHeap->setSeqDataArchive(seqArc);
|
||||
size_t resMaxSize = JASResArcLoader::getResMaxSize(seqArc);
|
||||
|
||||
Reference in New Issue
Block a user