Rick Parrish wrote:
> 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.
Wrong! There are many many examples of classes implementing
THREADSAFE_ISUPPORTS but the class is not. Until we have the concept of
co-classes, the only think that QueryInterface'ing for the ID
NS_ISTHREADSAFE_IID call tell you is that the ISUPPORTS is threadsafe
(coclass can give class information).
This history here is that NS_IMPL_THREADSAFE_ISUPPORTS4 along with the
assertion in the non-threadsafe ISUPPORT macro impl. The problem was
that this not threadsafe assert generated so many assertions, people
simple either disabled the assertion or they changed their class to
implement the threadsafe version! Needless to day, bad bad bad.
Also, there is a bug that requires uses of xpcom proxy to implement a
threadsafe version of ISUPPORTS. This can be fixed, but it is another
example of threadsafety problems that mozilla has.