mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 17:23:59 +00:00
Bugzilla bug #39942: additional tweaks related to the thread-private
error string buffer. Modified files: prerror.c, prcthr.c, pruthr.c
This commit is contained in:
parent
5fb749ab79
commit
d961ab7c89
@ -65,7 +65,7 @@ PR_IMPLEMENT(void) PR_SetErrorText(PRIntn textLength, const char *text)
|
||||
{
|
||||
if (NULL != thread->errorString)
|
||||
PR_DELETE(thread->errorString);
|
||||
thread->errorStringSize = 0;
|
||||
thread->errorStringSize = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -82,9 +82,9 @@ PR_IMPLEMENT(void) PR_SetErrorText(PRIntn textLength, const char *text)
|
||||
}
|
||||
thread->errorStringSize = size;
|
||||
}
|
||||
thread->errorStringLength = textLength;
|
||||
memcpy(thread->errorString, text, textLength+1 );
|
||||
}
|
||||
thread->errorStringLength = textLength;
|
||||
}
|
||||
|
||||
PR_IMPLEMENT(PRInt32) PR_GetErrorTextLength(void)
|
||||
@ -96,7 +96,7 @@ PR_IMPLEMENT(PRInt32) PR_GetErrorTextLength(void)
|
||||
PR_IMPLEMENT(PRInt32) PR_GetErrorText(char *text)
|
||||
{
|
||||
PRThread *thread = PR_GetCurrentThread();
|
||||
if (0 != thread->errorStringSize)
|
||||
if (0 != thread->errorStringLength)
|
||||
memcpy(text, thread->errorString, thread->errorStringLength+1);
|
||||
return thread->errorStringLength;
|
||||
} /* PR_GetErrorText */
|
||||
|
@ -258,6 +258,7 @@ static void _PR_InitializeRecycledThread(PRThread *thread)
|
||||
#endif
|
||||
PR_ASSERT(thread->dumpArg == 0 && thread->dump == 0);
|
||||
PR_ASSERT(thread->errorString == 0 && thread->errorStringSize == 0);
|
||||
PR_ASSERT(thread->errorStringLength == 0);
|
||||
|
||||
/* Reset data members in thread structure */
|
||||
thread->errorCode = thread->osErrorCode = 0;
|
||||
|
@ -68,6 +68,7 @@ void _PR_CleanupThread(PRThread *thread)
|
||||
|
||||
PR_DELETE(thread->errorString);
|
||||
thread->errorStringSize = 0;
|
||||
thread->errorStringLength = 0;
|
||||
thread->environment = NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user