On Wed, Oct 22, 2008 at 12:46:39PM +0100, Rob Shearman wrote: > 2008/10/21 Huw Davies <[EMAIL PROTECTED]>: > > @@ -1728,6 +1767,10 @@ static HRESULT WINAPI > > DefaultHandler_IPersistStorage_HandsOffStorage( > > if(SUCCEEDED(hr) && object_is_running(This)) > > hr = IPersistStorage_HandsOffStorage(This->pPSDelegate); > > > > + old_stg = InterlockedExchangePointer((void**)&This->storage, NULL); > > IIRC, the default handler is apartment-threaded only, meaning that a > default handler object cannot be used on a thread other than the one > it was created on.
That's true I believe. > Adding constructs like this introduce confusion to > future developers about whether the code is or isn't thread-safe and > so it should be avoided and a non-thread-safe construct used instead. I don't buy this. Besides we're already using Interlocked{In,De}crement(). Huw. -- Huw Davies [EMAIL PROTECTED]