MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / OSJamMessage

Function OSJamMessage

src/dolphin/src/os/OSMessage.c:63–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63BOOL OSJamMessage(OSMessageQueue* mq, OSMessage msg, s32 flags) {
64 BOOL enabled;
65
66 enabled = OSDisableInterrupts();
67
68 while (mq->msgCount <= mq->usedCount)
69 {
70 if (!(flags & OS_MESSAGE_BLOCK)) {
71 OSRestoreInterrupts(enabled);
72 return FALSE;
73 } else {
74 OSSleepThread(&mq->queueSend);
75 }
76 }
77
78 mq->firstIndex = (mq->firstIndex + mq->msgCount - 1) % mq->msgCount;
79 mq->msgArray[mq->firstIndex] = msg;
80 mq->usedCount++;
81
82 OSWakeupThread(&mq->queueReceive);
83
84 OSRestoreInterrupts(enabled);
85 return TRUE;
86}

Callers

nothing calls this directly

Calls 3

OSDisableInterruptsFunction · 0.85
OSSleepThreadFunction · 0.85
OSWakeupThreadFunction · 0.85

Tested by

no test coverage detected