Changeset c2050ce0c6de…
Parent 38f47b6798cb…
by
Changes to 4 files · Browse files at c2050ce0c6de Showing diff from parent 38f47b6798cb Diff from another changeset...
@@ -986,15 +986,13 @@
STDMETHODIMP_(ULONG) CShellExtCMenu::AddRef()
{
- ThgCriticalSection cs(CShellExt::GetCriticalSection());
- return ++m_cRef;
+ return ::InterlockedIncrement(&m_cRef);
}
STDMETHODIMP_(ULONG) CShellExtCMenu::Release()
{
- ThgCriticalSection cs(CShellExt::GetCriticalSection());
- if(--m_cRef)
+ if(::InterlockedDecrement(&m_cRef))
return m_cRef;
delete this;
return 0L;
|
@@ -90,15 +90,13 @@
STDMETHODIMP_(ULONG) CShellExtOverlay::AddRef()
{
- ThgCriticalSection cs(CShellExt::GetCriticalSection());
- return ++m_cRef;
+ return ::InterlockedIncrement(&m_cRef);
}
STDMETHODIMP_(ULONG) CShellExtOverlay::Release()
{
- ThgCriticalSection cs(CShellExt::GetCriticalSection());
- if(--m_cRef)
+ if(::InterlockedDecrement(&m_cRef))
return m_cRef;
delete this;
return 0L;
|
@@ -155,13 +155,11 @@
void CShellExt::IncDllRef()
{
- ThgCriticalSection cs(CShellExt::GetCriticalSection());
- g_cRefThisDll++;
+ ::InterlockedIncrement(&g_cRefThisDll);
}
void CShellExt::DecDllRef()
{
- ThgCriticalSection cs(CShellExt::GetCriticalSection());
- g_cRefThisDll--;
+ ::InterlockedDecrement(&g_cRefThisDll);
}
|
@@ -46,15 +46,13 @@
STDMETHODIMP_(ULONG) AddRef()
{
- ThgCriticalSection cs(CShellExt::GetCriticalSection());
- return ++m_cRef;
+ return ::InterlockedIncrement(&m_cRef);
}
STDMETHODIMP_(ULONG) Release()
{
- ThgCriticalSection cs(CShellExt::GetCriticalSection());
- if (--m_cRef)
+ if (::InterlockedDecrement(&m_cRef))
return m_cRef;
delete this;
|
Loading...