Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
#define P6_REFCOUNTED_THREADSAFE_RELEASE (   classname)
Value:
P6ASSERT(0 != m_cRef.value); \
P6R::P6INT32 tmp = P6R::p6AtomicDec32(&m_cRef.value); \
P6R::p6TraceRelease(#classname,this,tmp,NULL); \
if(0 == tmp) { delete this; } \
return tmp; \
}
#define P6ASSERT(expr)
P6ASSERT should be used in place of any platform/compiler specific assert.
Definition: p6defs.h:238
P6API P6INT32 P6CCALL p6AtomicDec32(P6INT32 volatile *pVar)
Atomically decrements the variable pointed to by pVar by one.
#define P6COMMETHOD_(type)
Definition: p6defs.h:181
int32_t P6INT32
Definition: p6types.h:76

The P6_REFCOUNTED_THREADSAFE_RELEASE helper macro implements a threadsafe release() method for use in classes which inhereit from p6IRefCounted.

The macro assumes that a member variable of type P6AUTO_INT32 named m_cRef existss in the class. This macro is called by the P6_REFCOUNTED macro.

Parameters
classnameThe name of the class in which the release() method is being declared/implemented.

Definition at line 576 of file p6comhlpr.h.