Closed Bug 903270 Opened 11 years ago Closed 11 years ago

set thread name for initial event of NS_NewNamedThread()

Categories

(Core :: XPCOM, defect)

x86_64
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla26

People

(Reporter: karlt, Assigned: karlt)

References

Details

Attachments

(3 files)

Some clients are using NS_NewNamedThread() to start a thread, with a single event.
Attached patch patchSplinter Review
Assignee: nobody → karlt
Status: NEW → ASSIGNED
Attachment #787952 - Flags: review?(continuation)
Comment on attachment 787952 [details] [diff] [review] patch I'm not an XPCOM peer, and jlebar is out for a few days, so bouncing this to bsmedberg.
Attachment #787952 - Flags: review?(continuation) → review?(benjamin)
Attachment #787952 - Flags: review?(benjamin) → review?(doug.turner)
Comment on attachment 787952 [details] [diff] [review] patch Review of attachment 787952 [details] [diff] [review]: ----------------------------------------------------------------- Could you drop the last argument from the following places: http://mxr.mozilla.org/mozilla-central/source/content/media/MediaDecoderStateMachine.cpp#253 http://mxr.mozilla.org/mozilla-central/source/content/media/MediaDecoderStateMachine.cpp#1755 http://mxr.mozilla.org/mozilla-central/source/content/media/webrtc/MediaEngineWebRTC.h#114 ::: xpcom/glue/nsThreadUtils.h @@ +73,5 @@ > + nsresult rv = NS_NewThread(result, nullptr, stackSize); > + NS_ENSURE_SUCCESS(rv, rv); > + NS_SetThreadName<LEN>(*result, name); > + if (initialEvent) > + rv = (*result)->Dispatch(initialEvent, NS_DISPATCH_NORMAL); Did we use to just drop the initial event? http://mxr.mozilla.org/mozilla-central/source/content/media/MediaStreamGraph.cpp#1427 @@ +75,5 @@ > + NS_SetThreadName<LEN>(*result, name); > + if (initialEvent) > + rv = (*result)->Dispatch(initialEvent, NS_DISPATCH_NORMAL); > + > + return rv; NS_WARN (or whatever) before the return?
Attachment #787952 - Flags: review?(doug.turner) → review+
(In reply to Doug Turner (:dougt) from comment #3) > Did we use to just drop the initial event? It was passed to NS_NewThread() before. > @@ +75,5 @@ > > + NS_SetThreadName<LEN>(*result, name); > > + if (initialEvent) > > + rv = (*result)->Dispatch(initialEvent, NS_DISPATCH_NORMAL); > > + > > + return rv; > > NS_WARN (or whatever) before the return? - if (initialEvent) + if (initialEvent) { rv = (*result)->Dispatch(initialEvent, NS_DISPATCH_NORMAL); + NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "Initial event dispatch failed"); + }
+1
(In reply to Doug Turner (:dougt) from comment #3) > Could you drop the last argument from the following places: http://hg.mozilla.org/mozilla-central/annotate/60c382ba1773/content/media/MediaDecoderStateMachine.cpp#l1755 has a non-default stack-size. Looks like http://hg.mozilla.org/mozilla-central/annotate/60c382ba1773/content/media/MediaDecoderStateMachine.cpp#l253 had a non-default stack-size before http://hg.mozilla.org/mozilla-central/rev/8eb1a29b4aa0 Bug 691096 comment 25 indicates that was intentional.
Attachment #795267 - Attachment description: camera.null.event → remove default null initial event parameter from NS_NewNamedThread() call site
Attachment #795269 - Flags: review?(chris.double) → review+
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
Attachment #795267 - Flags: review?(chung) → review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: