Closed Bug 1333655 Opened 4 years ago Closed 4 years ago

Improve the profiler's Thread class

Categories

(Core :: Gecko Profiler, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla54
Tracking Status
firefox54 --- fixed

People

(Reporter: njn, Assigned: njn)

References

Details

Attachments

(1 file, 1 obsolete file)

It's a clumsy cross-platform abstraction. GetCurrentId() and tid_t are the only
genuinely cross-platform things in it, and the patch keeps those in place.

The remaining methods are not implemented on all platforms (none are
implemented on Linux) and the fields are all used on either Mac or Windows, but
not both. So the patch introduces MacOSThread and Win32Thread classes and moves
the relevant Thread method implementations and fields into them. There is
sufficiently little overlap between the two new classes that there is no point
sharing a base class between them.

The patch also changes some of the existing code to use Gecko style, e.g.
|mFoo| instead of |foo_| for class fields.
Comment on attachment 8830125 [details] [diff] [review]
Improve the profiler's Thread class

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

Ok. Without the standalone build requirement, there's not much reason not to use PR_CreateThread and friends, is there?
Attachment #8830125 - Flags: review?(mstange) → review+
Sorry that I'm asking for re-review, but I realized that Win32Thread and
MacOSThread both had a single sub-class (two different versions of
SamplerThread) and that this sub-classing is unnecessary. Removing it gets rid
of some virtual methods and simplifies thread naming on Mac.
Attachment #8831001 - Flags: review?(mstange)
Attachment #8830125 - Attachment is obsolete: true
Attachment #8831001 - Flags: review?(mstange) → review+
https://hg.mozilla.org/mozilla-central/rev/31af743f4a02
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
You need to log in before you can comment on or make changes to this bug.