os: Implement MessageQueue - #85
Conversation
MonsterDruide1
left a comment
There was a problem hiding this comment.
@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);
}|
Sorry for the workflow hiccup - the issue has been addressed and fixed in MonsterDruide1/OdysseyDecomp#1367. |
Nitr4m12
left a comment
There was a problem hiding this comment.
@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
left a comment
There was a problem hiding this comment.
@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
left a comment
There was a problem hiding this comment.
@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
left a comment
There was a problem hiding this comment.
@MonsterDruide1 reviewed 1 file and all commit messages, and resolved 1 discussion.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on Nitr4m12).
Similar to
os::Mutexandos::Event, this class also just calls global functions. That is about all there is to it.This change is