| 61 | } |
| 62 | |
| 63 | BOOL 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 | } |
nothing calls this directly
no test coverage detected