Closed Bug 372546 Opened 17 years ago Closed 17 years ago

Mark pipe input/output streams as threadsafe

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9alpha3

People

(Reporter: Waldo, Assigned: Waldo)

References

Details

Attachments

(1 file, 1 obsolete file)

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.
Attached patch Patch (obsolete) — Splinter Review
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?
(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)
Attachment #258132 - Flags: review?(benjamin) → review+
Fixed.
Blocks: 365043
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: