nsDirectoryService is not threadsafe even though it uses threadsafe AddRef/Release

NEW
Unassigned

Status

()

Core
XPCOM
6 years ago
6 months ago

People

(Reporter: Ben Turner (not reading bugmail, use the needinfo flag!), Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

nsDirectoryService is not threadsafe even though it uses threadsafe AddRef/Release. It accesses a hash table and JS components from whatever thread it is called on, and none of that is safe.
It probably had threadsafe AddRef/Release for use with XPCOM proxies.  We should kill that.

Comment 2

6 years ago
Yeah, we should refuse to make directory service *usable* on other threads with assertions. I'm not sure I care as much about the refcounting if there's code actually using some kind of hand-rolled proxy, although that really shouldn't be necessary.
You need to log in before you can comment on or make changes to this bug.