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

Fix THREAD_CPUTIME clock_time_get on Windows #181

Merged
merged 1 commit into from
Jan 16, 2023

Conversation

ospencer
Copy link
Member

@phated and I found that clock_time_get on Windows would return Bad file descriptor when asking for the thread time on Windows, i.e. uvwasi_clock_time_get for UVWASI_CLOCK_THREAD_CPUTIME_ID.

I saw it was just because GetProcessTimes was being called for both processes and threads, but threads specifically need GetThreadTimes.

I added some basic smoke tests (just ensuring the calls don't fail and that the returned times are non-zero), and tested this on a Windows machine and it appears to work.

Let me know if anything else is needed to get this landed 🙂

Copy link
Collaborator

@cjihrig cjihrig left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

@cjihrig cjihrig merged commit 334b186 into nodejs:main Jan 16, 2023
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