Fix 31998 nsScriptSecurityManager not thread safe breaks table regress

This commit is contained in:
norris%netscape.com 2000-03-21 23:12:16 +00:00
Родитель 8f3d31ec3c
Коммит ea9d7682c1
1 изменённых файлов: 7 добавлений и 7 удалений

Просмотреть файл

@ -87,9 +87,9 @@ className::AddRef(void) \
{ \
NS_PRECONDITION(PRInt32(mRefCnt) == 0, "illegal mRefCnt"); \
NS_PRECONDITION(PRInt32(mJSPrincipals.refcount) >= 0, "illegal refcnt");\
++mJSPrincipals.refcount; \
NS_LOG_ADDREF(this, mJSPrincipals.refcount, #className, sizeof(*this)); \
return mJSPrincipals.refcount; \
nsrefcnt count = PR_AtomicIncrement((PRInt32 *)&mJSPrincipals.refcount);\
NS_LOG_ADDREF(this, count, #className, sizeof(*this)); \
return count; \
}
#define NSBASEPRINCIPALS_RELEASE(className) \
@ -98,13 +98,13 @@ className::Release(void) \
{ \
NS_PRECONDITION(PRInt32(mRefCnt) == 0, "illegal mRefCnt"); \
NS_PRECONDITION(0 != mJSPrincipals.refcount, "dup release"); \
--mJSPrincipals.refcount; \
NS_LOG_RELEASE(this, mJSPrincipals.refcount, #className); \
if (mJSPrincipals.refcount == 0) { \
nsrefcnt count = PR_AtomicDecrement((PRInt32 *)&mJSPrincipals.refcount);\
NS_LOG_RELEASE(this, count, #className); \
if (count == 0) { \
NS_DELETEXPCOM(this); \
return 0; \
} \
return mJSPrincipals.refcount; \
return count; \
}
#endif // _NS_BASE_PRINCIPAL_H_