Mark pipe input/output streams as threadsafe

RESOLVED FIXED in mozilla1.9alpha3

Status

()

Core
XPCOM
RESOLVED FIXED
11 years ago
11 years ago

People

(Reporter: Waldo, Assigned: Waldo)

Tracking

Trunk
mozilla1.9alpha3
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

11 years ago
In my work on the HTTP server in bug 370245, I'm getting the following message printed to console:

!!!!! XPConnect wrapper thread use error...
  XPConnect WrappedNative is being accessed on multiple threads but the underlying native xpcom object does not have a nsIClassInfo with the 'THREADSAFE' flag set
  wrapper: [xpconnect wrapped nsIOutputStream @ 0x8114230 (native @ 0x80e93d8)]

The JS stack indicates that the wrapper is on the output stream created from |socketTransport.openOutputStream(OPEN_BLOCKING, 0, 0)|.  This stream is from a pipe, so nsPipeOutputStream needs to be marked as threadsafe.

I hope to get to this soon, but classes may get in the way.
(Assignee)

Comment 1

11 years ago
Created attachment 258084 [details] [diff] [review]
Patch

This would also fix bug 365043.
Attachment #258084 - Flags: review?(benjamin)
Comment on attachment 258084 [details] [diff] [review]
Patch

+NS_IMPL_CI_INTERFACE_GETTER3(nsPipeOutputStream,

how about putting those near the IMPL_ISUPPORTS/IMPL_QUERY_INTERFACE lines, so that it's more likely that people will change both when making this class implement a new interface?
(Assignee)

Comment 3

11 years ago
Created attachment 258132 [details] [diff] [review]
Move QI impls. up next to the CI impls

(In reply to comment #2)
> +NS_IMPL_CI_INTERFACE_GETTER3(nsPipeOutputStream,
> 
> how about putting those near the IMPL_ISUPPORTS/IMPL_QUERY_INTERFACE lines, so
> that it's more likely that people will change both when making this class
> implement a new interface?

Good point; I should have seen this, given how difficult it was to find the QI impls to change them.  I moved the QI implementations up to the very top of each one's section, so hopefully future readers can find/sync them more easily.
Attachment #258084 - Attachment is obsolete: true
Attachment #258132 - Flags: review?(benjamin)
Attachment #258084 - Flags: review?(benjamin)

Updated

11 years ago
Attachment #258132 - Flags: review?(benjamin) → review+
(Assignee)

Comment 4

11 years ago
Fixed.
Blocks: 365043
Status: ASSIGNED → RESOLVED
Last Resolved: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.