well the debug assertion failure i am getting is in nsDebug.cpp.
 NS_CheckThreadSafe(void* owningThread, const char* msg)

As u said perhaps this code gets executed for
"checking to verify that the thread that allocated a chunk of memory is the
same on that frees it. "

But is that the only reason. or is there any other reason why one would
check for Thread safety.

So suppose a person wants to add a component in Mozilla which has mutiple
threads in it, then he has to implement thread safe feature which will aloow
him to check for thread safty. am i right??



Thanks in advance

Regards
Prasanna








"Rick Parrish" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Anandprasanna Gaitonde wrote:
>
> > HI all,
> >
> > I am eager to know  the meaning of  the macro
> > NS_IMPL_THREADSAFE_ISUPPORTS4(...)
>
>
> A component can identify itself as being "threadsafe"
> by returning "NS_OK" in response to a call to QueryInterface()
> with an interface ID of NS_ISTHREADSAFE_IID.
>
> The macro is defined here ...
>
> http://lxr.mozilla.org/mozilla/source/xpcom/base/nsISupportsUtils.h
>
>
> > What does it do and when should it be used.???
>
>
> It operates the same as NS_IMPL_ISUPPORTSx() but includes the
> extra interface ID that marks the component as threadsafe.
>
>
> > Actually i am using it and getting a Debug Assertion failure.in file
> > dbgheap.c  . I am working on WIN NT.
>
>
> You'll need to be more specific - what line? In most cases, debug
> assertions related the threading are caused by the debug code checking
> to verify that the thread that allocated a chunk of memory is the
> same on that frees it. Simply replacing NS_IMPL_ISUPPORTS with
> NS_IMPL_THREADSAFE_ISUPPORTS won't fix this. You may want to look
> at implementing nsIRunnable interface and also take at look at
> the service manager's GetProxyForObject (or something like that)
> method to assist in threading issues.
>
>
> > Please provide info on the macro.
> >
> > Thanks ina advance
>
> Good luck,
> Rick
>
>



Reply via email to