This is a known problem that is being worked on. Since the calls to the
nsCategoryManager all happen
only from services within necko (in paricular, from nsIOService and
nsHTTPHandler), you could try
initializing necko and HTTP from the same thread that invokes
Init_XPCOM. To do this, just create an
HTTP url. I think that this should do the trick.
Darin
Rick Marvin wrote:
> From the comments in the TestThreadedIO.cpp within the netwerk/tests
> directory, I have discovered that it is not possible to do an asynchRead
> from a child thread.
>
> "// This test attempts to load a URL on a separate thread. It is currently
> // designed simply to expose the problems inherent in such an ambitous task
> // (i.e., it don't work)."
>
> Are there any work arounds?
>
> I am attempting to build an XPCom object which would retreive various URLs
> on an interval basis. I am attempting to utilize the necko engine, however,
> because my call to asynchRead is invoked within a child thread, I am
> asserting when trying to create a URI. (nsCategoryManager not thread safe- I
> invoked Init_XPCOM from the main thread which is where the nsCategoryManager
> was created.)
>
> Any ideas would be appreciated
>
> Rick Marvin
> (Neoplanet)
>
>