Add GetCurrentVirtualThread and GetCurrentPhysicalThread

RESOLVED FIXED in Firefox 55

Status

()

Core
XPCOM
RESOLVED FIXED
a year ago
a year ago

People

(Reporter: billm, Assigned: billm)

Tracking

unspecified
mozilla55
Points:
---

Firefox Tracking Flags

(firefox55 fixed)

Details

Attachments

(1 attachment)

Created attachment 8863939 [details] [diff] [review]
patch

This change adds some functions that should be used instead of PR_GetCurrentThread. They both return a PRThread. GetCurrentPhysicalThread does exactly the same thing as PR_GetCurrentThread, but it makes it clearer what you're getting when there are cooperatively scheduled threads running.

GetCurrentVirtualThread returns the same value for all threads in a cooperative thread pool. The actual value it returns is somewhat immaterial. I kinda wonder if we should just make a new opaque type for it? Maybe a class with a single PRThread* field that would be passed around by value?

Anyway, the implementation of these two methods just calls PR_GetCurrentThread() for now. We can fix it up later to do whatever we need.
Attachment #8863939 - Flags: review?(nfroyd)
Comment on attachment 8863939 [details] [diff] [review]
patch

Review of attachment 8863939 [details] [diff] [review]:
-----------------------------------------------------------------

This works for me, thanks!  ++ for the comments as well.
Attachment #8863939 - Flags: review?(nfroyd) → review+

Comment 2

a year ago
Pushed by wmccloskey@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/d289923632be
Add GetCurrentVirtualThread function (r=froydnj)

Comment 3

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/d289923632be
Status: NEW → RESOLVED
Last Resolved: a year ago
status-firefox55: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.