Skip to content

os: Implement MessageQueue - #85

Merged
MonsterDruide1 merged 1 commit into
open-ead:masterfrom
Nitr4m12:messageq
Sep 17, 2026
Merged

MonsterDruide1 merged 1 commit into
open-ead:masterfrom
Nitr4m12:messageq

Conversation

@Nitr4m12

@Nitr4m12 Nitr4m12 commented Sep 15, 2026 •

Copy link
Copy Markdown

Similar to os::Mutex and os::Event, this class also just calls global functions. That is about all there is to it.


This change is Reviewable

@MonsterDruide1 MonsterDruide1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MonsterDruide1 reviewed 3 files and all commit messages, and made 2 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on Nitr4m12).


include/nn/os/os_MessageQueue.h line 22 at r1 (raw file):

void PeekMessageQueue(u64*, MessageQueueType const*);
bool TryPeekMessageQueue(u64*, MessageQueueType const*);
bool TimedPeekMessageQueue(u64*, MessageQueueType const*, nn::TimeSpan);

I know it was wrong before, but can we change it to the "right" one here?

Suggestion:

void PeekMessageQueue(u64*, const MessageQueueType*);
bool TryPeekMessageQueue(u64*, const MessageQueueType*);
bool TimedPeekMessageQueue(u64*, const MessageQueueType*, nn::TimeSpan);

include/nn/os/os_MessageQueue.h line 69 at r1 (raw file):

    bool TimedPeek(uintptr_t* outData, TimeSpan timeSpan) {
        return TimedPeekMessageQueue(outData, &m_MessageQueue, timeSpan);
    }

Suggestion:

    void Peek(uintptr_t* outData) const { PeekMessageQueue(outData, &m_MessageQueue); }

    bool TryPeek(uintptr_t* outData) const { return TryPeekMessageQueue(outData, &m_MessageQueue); }

    bool TimedPeek(uintptr_t* outData, TimeSpan timeSpan) const {
        return TimedPeekMessageQueue(outData, &m_MessageQueue, timeSpan);
    }

@MonsterDruide1

Copy link
Copy Markdown
Member

Sorry for the workflow hiccup - the issue has been addressed and fixed in MonsterDruide1/OdysseyDecomp#1367.

@Nitr4m12 Nitr4m12 left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Nitr4m12 reviewed 3 files and all commit messages, and made 2 comments.
Reviewable status: 2 of 3 files reviewed, 2 unresolved discussions (waiting on MonsterDruide1).


include/nn/os/os_MessageQueue.h line 22 at r1 (raw file):

Previously, MonsterDruide1 wrote…

I know it was wrong before, but can we change it to the "right" one here?

Done


include/nn/os/os_MessageQueue.h line 69 at r1 (raw file):

    bool TimedPeek(uintptr_t* outData, TimeSpan timeSpan) {
        return TimedPeekMessageQueue(outData, &m_MessageQueue, timeSpan);
    }

Looking at info from dwarf, this functions are not marked const, so it might cause issues later.

@MonsterDruide1 MonsterDruide1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MonsterDruide1 reviewed 1 file and all commit messages, made 2 comments, and resolved 2 discussions.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on Nitr4m12).


include/nn/os/os_MessageQueue.h line 69 at r1 (raw file):

Previously, Nitr4m12 wrote…

Looking at info from dwarf, this functions are not marked const, so it might cause issues later.

Funny, thanks for pointing that out. I created a new suggestion to face this.


include/nn/os/os_MessageQueue.h line 69 at r2 (raw file):

    bool TimedPeek(uintptr_t* outData, TimeSpan timeSpan) {
        return TimedPeekMessageQueue(outData, &m_MessageQueue, timeSpan);
    }

Suggestion:

    /// XXX: `Peek` functions could be `const`, but according to DWARF from [INSERT GAME HERE], they are not
    void Peek(uintptr_t* outData) { PeekMessageQueue(outData, &m_MessageQueue); }

    bool TryPeek(uintptr_t* outData) { return TryPeekMessageQueue(outData, &m_MessageQueue); }

    bool TimedPeek(uintptr_t* outData, TimeSpan timeSpan) {
        return TimedPeekMessageQueue(outData, &m_MessageQueue, timeSpan);
    }

@Nitr4m12 Nitr4m12 left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Nitr4m12 reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status: 2 of 3 files reviewed, 1 unresolved discussion (waiting on MonsterDruide1).


include/nn/os/os_MessageQueue.h line 69 at r2 (raw file):

    bool TimedPeek(uintptr_t* outData, TimeSpan timeSpan) {
        return TimedPeekMessageQueue(outData, &m_MessageQueue, timeSpan);
    }

Done

@MonsterDruide1 MonsterDruide1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MonsterDruide1 reviewed 1 file and all commit messages, and resolved 1 discussion.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on Nitr4m12).

@MonsterDruide1
MonsterDruide1 merged commit fed45e2 into open-ead:master Sep 17, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants