Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

orbis-kernel: umtx_cv_wait ABSTIME #80

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

IsaacMarovitz
Copy link
Contributor

No description provided.

Copy link
Contributor

@DHrpcs3 DHrpcs3 left a comment

Choose a reason for hiding this comment

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

Seems you can just remove following lines to get similar behavior, it should also solve issue with overflow

    std::abort();
    return ErrorCode::NOSYS;

It is still not accurate implementation, we should use futex wait with abstime if possible and parse clockId


if ((wflags & kCvWaitAbsTime) != 0) {
udiff = std::chrono::time_point_cast<std::chrono::microseconds>(
std::chrono::high_resolution_clock::now())
Copy link
Contributor

Choose a reason for hiding this comment

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

steady_clock should be used

.time_since_epoch()
.count();
}

while (true) {
result = ErrorCode{node->second.cv.wait(chain.mtx, ut - udiff)};
Copy link
Contributor

Choose a reason for hiding this comment

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

if udiff > ut, there will be big number

@DHrpcs3 DHrpcs3 force-pushed the master branch 2 times, most recently from a0dac15 to ddad35e Compare November 14, 2024 17:07
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