Closed
Bug 443874
Opened 17 years ago
Closed 17 years ago
Need a hook for thread creation and destruction in thread pool
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
People
(Reporter: bent.mozilla, Assigned: bent.mozilla)
References
Details
Attachments
(2 files, 1 obsolete file)
13.93 KB,
patch
|
benjamin
:
review+
|
Details | Diff | Splinter Review |
4.26 KB,
patch
|
jst
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
The JS engine asserts that all contexts created on a particular thread have been destroyed by the time the thread dies, and it asserts this at thread destruction time via NSPR's per-thread data destruction mechanism. I'm using a thread pool to create per-thread contexts in bug 437152 and I needed a way to be notified when a thread was created and destroyed in the pool to prevent the assertions. I couldn't use the per-thread data destructor mechanism because the JS engine does the same thing (and registers its TLS index first).
Attached is one possible fix. Benjamin, what do you think?
Attachment #328298 -
Flags: review?(benjamin)
Updated•17 years ago
|
Version: unspecified → Trunk
Comment 1•17 years ago
|
||
Comment on attachment 328298 [details] [diff] [review]
Patch, v1
I'd really love a test for this...
Attachment #328298 -
Flags: review?(benjamin) → review-
Assignee | ||
Comment 2•17 years ago
|
||
Ok, this has tests. It also makes the thread pool release the listener after the shutdown() method rather than waiting until the thread pool is destroyed.
Attachment #328298 -
Attachment is obsolete: true
Attachment #330118 -
Flags: review?(benjamin)
Updated•17 years ago
|
Attachment #330118 -
Flags: review?(benjamin) → review+
Assignee | ||
Comment 3•17 years ago
|
||
Pushed to moz-central.
Mossop realized I forgot to bump the uuid of nsIThreadPool. Checked in a followup that did only that.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 4•17 years ago
|
||
The test is hanging on one windows box... I disabled it for the moment until I get a windows build going.
Comment 5•17 years ago
|
||
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1216978929.1216982107.8538.gz&fulltext=1#err0
MacOSX Darwin 9.2.2 mozilla-central qm-moz2mini01
Finished running TestTextFormatter
Running TestThreadPoolListener
Running ThreadPoolListener tests...
../../dist/bin/run-mozilla.sh: line 131: 90077 Segmentation fault "$prog" ${1+"$@"}
make[2]: *** [check] Error 139
make[1]: *** [check] Error 2
make: *** [check] Error 2
![]() |
||
Comment 6•17 years ago
|
||
SeaMonkey Mac (Tiger) is timing out on that test frequently, it only passes very rarely.
Comment 7•17 years ago
|
||
I've backed this out with changeset 29af572a67ba due to multiple test failures.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 8•17 years ago
|
||
I believe that the real fix for the test failures is bug 449822, but I'll test by a cheap workaround.
Assignee | ||
Comment 9•17 years ago
|
||
This applies on top of attachment 330118 [details] [diff] [review] and, if my theory is correct, should fix the hanging/crashing unit tests we saw on tinderbox.
Attachment #333247 -
Flags: review?(jst)
Updated•17 years ago
|
Attachment #333247 -
Flags: superreview+
Attachment #333247 -
Flags: review?(jst)
Attachment #333247 -
Flags: review+
Assignee | ||
Comment 10•17 years ago
|
||
Checked in, and it stuck this time!
Status: REOPENED → RESOLVED
Closed: 17 years ago → 17 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•