Bug 156633 replace PR_CurrentThread with PR_GetCurrentThread
patch by riceman+bmo@mail.rit.edu r=morse,dougt,dveditz,timeless sr=dveditz
This commit is contained in:
@@ -153,7 +153,7 @@ NS_IMETHODIMP
|
||||
nsJARChannel::Cancel(nsresult status)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
NS_ASSERTION(mInitiator == PR_CurrentThread(), "wrong thread");
|
||||
NS_ASSERTION(mInitiator == PR_GetCurrentThread(), "wrong thread");
|
||||
#endif
|
||||
NS_ASSERTION(NS_FAILED(status), "shouldn't cancel with a success code");
|
||||
nsresult rv = NS_OK;
|
||||
@@ -171,7 +171,7 @@ NS_IMETHODIMP
|
||||
nsJARChannel::Suspend()
|
||||
{
|
||||
#ifdef DEBUG
|
||||
NS_ASSERTION(mInitiator == PR_CurrentThread(), "wrong thread");
|
||||
NS_ASSERTION(mInitiator == PR_GetCurrentThread(), "wrong thread");
|
||||
#endif
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
@@ -186,7 +186,7 @@ NS_IMETHODIMP
|
||||
nsJARChannel::Resume()
|
||||
{
|
||||
#ifdef DEBUG
|
||||
NS_ASSERTION(mInitiator == PR_CurrentThread(), "wrong thread");
|
||||
NS_ASSERTION(mInitiator == PR_GetCurrentThread(), "wrong thread");
|
||||
#endif
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
@@ -264,7 +264,7 @@ nsJARChannel::AsyncOpen(nsIStreamListener* listener, nsISupports* ctxt)
|
||||
nsresult rv;
|
||||
|
||||
#ifdef DEBUG
|
||||
mInitiator = PR_CurrentThread();
|
||||
mInitiator = PR_GetCurrentThread();
|
||||
#endif
|
||||
|
||||
mUserContext = ctxt;
|
||||
@@ -577,7 +577,7 @@ nsJARChannel::OnStartRequest(nsIRequest* jarExtractionTransport,
|
||||
nsISupports* context)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
NS_ASSERTION(mInitiator == PR_CurrentThread(), "wrong thread");
|
||||
NS_ASSERTION(mInitiator == PR_GetCurrentThread(), "wrong thread");
|
||||
#endif
|
||||
return mUserListener->OnStartRequest(this, mUserContext);
|
||||
}
|
||||
@@ -588,7 +588,7 @@ nsJARChannel::OnStopRequest(nsIRequest* jarExtractionTransport, nsISupports* con
|
||||
{
|
||||
nsresult rv;
|
||||
#ifdef DEBUG
|
||||
NS_ASSERTION(mInitiator == PR_CurrentThread(), "wrong thread");
|
||||
NS_ASSERTION(mInitiator == PR_GetCurrentThread(), "wrong thread");
|
||||
#endif
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gJarProtocolLog, PR_LOG_DEBUG)) {
|
||||
@@ -626,7 +626,7 @@ nsJARChannel::OnDataAvailable(nsIRequest* jarCacheTransport,
|
||||
PRUint32 count)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
NS_ASSERTION(mInitiator == PR_CurrentThread(), "wrong thread");
|
||||
NS_ASSERTION(mInitiator == PR_GetCurrentThread(), "wrong thread");
|
||||
#endif
|
||||
return mUserListener->OnDataAvailable(this, mUserContext,
|
||||
inStr, sourceOffset, count);
|
||||
|
||||
@@ -109,7 +109,7 @@ nsSanePluginInstance::nsSanePluginInstance( void )
|
||||
mOnScanCompleteScript = nsnull;
|
||||
mOnInitCompleteScript = nsnull;
|
||||
mScanThread = nsnull;
|
||||
mUIThread = PR_CurrentThread();
|
||||
mUIThread = PR_GetCurrentThread();
|
||||
|
||||
mState = 0; // idle
|
||||
mSuccess = 1; // success
|
||||
@@ -682,7 +682,7 @@ nsSanePluginInstance::IsUIThread()
|
||||
if (!mUIThread)
|
||||
return PR_FALSE;
|
||||
|
||||
return (mUIThread == PR_CurrentThread());
|
||||
return (mUIThread == PR_GetCurrentThread());
|
||||
}
|
||||
|
||||
// End of Plugin Instance API Methods.
|
||||
|
||||
@@ -193,7 +193,7 @@ nsFileChannel::Cancel(nsresult status)
|
||||
{
|
||||
NS_ASSERTION(NS_FAILED(status), "shouldn't cancel with a success code");
|
||||
#ifdef DEBUG
|
||||
NS_ASSERTION(mInitiator == PR_CurrentThread(),
|
||||
NS_ASSERTION(mInitiator == PR_GetCurrentThread(),
|
||||
"wrong thread calling this routine");
|
||||
#endif
|
||||
mStatus = status;
|
||||
@@ -206,7 +206,7 @@ NS_IMETHODIMP
|
||||
nsFileChannel::Suspend()
|
||||
{
|
||||
#ifdef DEBUG
|
||||
NS_ASSERTION(mInitiator == PR_CurrentThread(),
|
||||
NS_ASSERTION(mInitiator == PR_GetCurrentThread(),
|
||||
"wrong thread calling this routine");
|
||||
#endif
|
||||
if (mCurrentRequest)
|
||||
@@ -218,7 +218,7 @@ NS_IMETHODIMP
|
||||
nsFileChannel::Resume()
|
||||
{
|
||||
#ifdef DEBUG
|
||||
NS_ASSERTION(mInitiator == PR_CurrentThread(),
|
||||
NS_ASSERTION(mInitiator == PR_GetCurrentThread(),
|
||||
"wrong thread calling this routine");
|
||||
#endif
|
||||
if (mCurrentRequest)
|
||||
@@ -323,9 +323,9 @@ nsFileChannel::AsyncOpen(nsIStreamListener *listener, nsISupports *ctxt)
|
||||
nsresult rv;
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_ASSERTION(mInitiator == nsnull || mInitiator == PR_CurrentThread(),
|
||||
NS_ASSERTION(mInitiator == nsnull || mInitiator == PR_GetCurrentThread(),
|
||||
"wrong thread calling this routine");
|
||||
mInitiator = PR_CurrentThread();
|
||||
mInitiator = PR_GetCurrentThread();
|
||||
#endif
|
||||
|
||||
if (mFileTransport)
|
||||
@@ -522,7 +522,7 @@ nsFileChannel::OnStartRequest(nsIRequest* request, nsISupports* context)
|
||||
// unconditionally inherit the status of the file transport
|
||||
request->GetStatus(&mStatus);
|
||||
#ifdef DEBUG
|
||||
NS_ASSERTION(mInitiator == PR_CurrentThread(),
|
||||
NS_ASSERTION(mInitiator == PR_GetCurrentThread(),
|
||||
"wrong thread calling this routine");
|
||||
#endif
|
||||
NS_ASSERTION(mRealListener, "No listener...");
|
||||
@@ -554,7 +554,7 @@ nsFileChannel::OnStopRequest(nsIRequest* request, nsISupports* context,
|
||||
mStatus = aStatus;
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_ASSERTION(mInitiator == PR_CurrentThread(),
|
||||
NS_ASSERTION(mInitiator == PR_GetCurrentThread(),
|
||||
"wrong thread calling this routine");
|
||||
#endif
|
||||
|
||||
@@ -583,7 +583,7 @@ nsFileChannel::OnDataAvailable(nsIRequest* request, nsISupports* context,
|
||||
PRUint32 aLength)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
NS_ASSERTION(mInitiator == PR_CurrentThread(),
|
||||
NS_ASSERTION(mInitiator == PR_GetCurrentThread(),
|
||||
"wrong thread calling this routine");
|
||||
#endif
|
||||
|
||||
|
||||
@@ -153,7 +153,7 @@ NS_IMETHODIMP
|
||||
nsJARChannel::Cancel(nsresult status)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
NS_ASSERTION(mInitiator == PR_CurrentThread(), "wrong thread");
|
||||
NS_ASSERTION(mInitiator == PR_GetCurrentThread(), "wrong thread");
|
||||
#endif
|
||||
NS_ASSERTION(NS_FAILED(status), "shouldn't cancel with a success code");
|
||||
nsresult rv = NS_OK;
|
||||
@@ -171,7 +171,7 @@ NS_IMETHODIMP
|
||||
nsJARChannel::Suspend()
|
||||
{
|
||||
#ifdef DEBUG
|
||||
NS_ASSERTION(mInitiator == PR_CurrentThread(), "wrong thread");
|
||||
NS_ASSERTION(mInitiator == PR_GetCurrentThread(), "wrong thread");
|
||||
#endif
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
@@ -186,7 +186,7 @@ NS_IMETHODIMP
|
||||
nsJARChannel::Resume()
|
||||
{
|
||||
#ifdef DEBUG
|
||||
NS_ASSERTION(mInitiator == PR_CurrentThread(), "wrong thread");
|
||||
NS_ASSERTION(mInitiator == PR_GetCurrentThread(), "wrong thread");
|
||||
#endif
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
@@ -264,7 +264,7 @@ nsJARChannel::AsyncOpen(nsIStreamListener* listener, nsISupports* ctxt)
|
||||
nsresult rv;
|
||||
|
||||
#ifdef DEBUG
|
||||
mInitiator = PR_CurrentThread();
|
||||
mInitiator = PR_GetCurrentThread();
|
||||
#endif
|
||||
|
||||
mUserContext = ctxt;
|
||||
@@ -577,7 +577,7 @@ nsJARChannel::OnStartRequest(nsIRequest* jarExtractionTransport,
|
||||
nsISupports* context)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
NS_ASSERTION(mInitiator == PR_CurrentThread(), "wrong thread");
|
||||
NS_ASSERTION(mInitiator == PR_GetCurrentThread(), "wrong thread");
|
||||
#endif
|
||||
return mUserListener->OnStartRequest(this, mUserContext);
|
||||
}
|
||||
@@ -588,7 +588,7 @@ nsJARChannel::OnStopRequest(nsIRequest* jarExtractionTransport, nsISupports* con
|
||||
{
|
||||
nsresult rv;
|
||||
#ifdef DEBUG
|
||||
NS_ASSERTION(mInitiator == PR_CurrentThread(), "wrong thread");
|
||||
NS_ASSERTION(mInitiator == PR_GetCurrentThread(), "wrong thread");
|
||||
#endif
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gJarProtocolLog, PR_LOG_DEBUG)) {
|
||||
@@ -626,7 +626,7 @@ nsJARChannel::OnDataAvailable(nsIRequest* jarCacheTransport,
|
||||
PRUint32 count)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
NS_ASSERTION(mInitiator == PR_CurrentThread(), "wrong thread");
|
||||
NS_ASSERTION(mInitiator == PR_GetCurrentThread(), "wrong thread");
|
||||
#endif
|
||||
return mUserListener->OnDataAvailable(this, mUserContext,
|
||||
inStr, sourceOffset, count);
|
||||
|
||||
@@ -260,7 +260,7 @@ InitQueue() {
|
||||
do_GetService(kEventQueueServiceCID, &rv);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't get event queue service");
|
||||
|
||||
rv = eventQService->GetThreadEventQueue(PR_CurrentThread(), &eventQueue);
|
||||
rv = eventQService->GetThreadEventQueue(PR_GetCurrentThread(), &eventQueue);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't get event queue for main thread");
|
||||
|
||||
return NS_OK;
|
||||
|
||||
@@ -268,7 +268,7 @@ InitQueue() {
|
||||
do_GetService(kEventQueueServiceCID, &rv);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't get event queue service");
|
||||
|
||||
rv = eventQService->GetThreadEventQueue(PR_CurrentThread(), &eventQueue);
|
||||
rv = eventQService->GetThreadEventQueue(PR_GetCurrentThread(), &eventQueue);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't get event queue for main thread");
|
||||
|
||||
return NS_OK;
|
||||
|
||||
@@ -151,7 +151,7 @@ void abnormal_exit_handler(int signum)
|
||||
|| (signum == SIGABRT)
|
||||
)
|
||||
{
|
||||
PR_CurrentThread();
|
||||
PR_GetCurrentThread();
|
||||
printf("prog = viewer\npid = %d\nsignal = %s\n", getpid(), strsignal(signum));
|
||||
|
||||
#if 0
|
||||
|
||||
@@ -146,7 +146,7 @@ static char _progname[1024] = "huh?";
|
||||
void
|
||||
ah_crap_handler(int signum)
|
||||
{
|
||||
PR_CurrentThread();
|
||||
PR_GetCurrentThread();
|
||||
|
||||
printf("prog = %s\npid = %d\nsignal = %s\n",
|
||||
_progname,
|
||||
|
||||
@@ -144,7 +144,7 @@ static char _progname[1024] = "huh?";
|
||||
void
|
||||
ah_crap_handler(int signum)
|
||||
{
|
||||
PR_CurrentThread();
|
||||
PR_GetCurrentThread();
|
||||
|
||||
printf("prog = %s\npid = %d\nsignal = %s\n",
|
||||
_progname,
|
||||
|
||||
@@ -489,7 +489,7 @@ NS_ErrorAccordingToNSPR()
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// This wrapper around PR_CurrentThread is simply here for debug builds so
|
||||
// This wrapper around PR_GetCurrentThread is simply here for debug builds so
|
||||
// that clients linking with xpcom don't also have to link with nspr explicitly.
|
||||
|
||||
#if defined(NS_DEBUG) && defined(NS_MT_SUPPORTED)
|
||||
@@ -503,7 +503,7 @@ extern "C" NS_COM void NS_CheckThreadSafe(void* owningThread, const char* msg);
|
||||
void*
|
||||
NS_CurrentThread(void)
|
||||
{
|
||||
void* th = PR_CurrentThread();
|
||||
void* th = PR_GetCurrentThread();
|
||||
return th;
|
||||
}
|
||||
|
||||
|
||||
@@ -275,14 +275,14 @@ nsThread::Init(nsIRunnable* runnable,
|
||||
NS_IMETHODIMP
|
||||
nsThread::GetCurrentThread(nsIThread * *aCurrentThread)
|
||||
{
|
||||
return GetIThread(PR_CurrentThread(), aCurrentThread);
|
||||
return GetIThread(PR_GetCurrentThread(), aCurrentThread);
|
||||
}
|
||||
|
||||
/* void sleep (in PRUint32 msec); */
|
||||
NS_IMETHODIMP
|
||||
nsThread::Sleep(PRUint32 msec)
|
||||
{
|
||||
if (PR_CurrentThread() != mThread)
|
||||
if (PR_GetCurrentThread() != mThread)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
if (PR_Sleep(PR_MillisecondsToInterval(msec)) != PR_SUCCESS)
|
||||
@@ -361,7 +361,7 @@ nsThread::WaitUntilReadyToStartMain()
|
||||
NS_COM nsresult
|
||||
nsIThread::GetCurrent(nsIThread* *result)
|
||||
{
|
||||
return GetIThread(PR_CurrentThread(), result);
|
||||
return GetIThread(PR_GetCurrentThread(), result);
|
||||
}
|
||||
|
||||
NS_COM nsresult
|
||||
@@ -424,7 +424,7 @@ nsIThread::IsMainThread()
|
||||
|
||||
PRThread *theMainThread;
|
||||
gMainThread->GetPRThread(&theMainThread);
|
||||
return theMainThread == PR_CurrentThread();
|
||||
return theMainThread == PR_GetCurrentThread();
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -346,7 +346,7 @@ PL_PostSynchronousEvent(PLEventQueue* self, PLEvent* event)
|
||||
PR_ASSERT(event != NULL);
|
||||
PR_Lock(event->lock);
|
||||
|
||||
if (PR_CurrentThread() == self->handlerThread) {
|
||||
if (PR_GetCurrentThread() == self->handlerThread) {
|
||||
/* Handle the case where the thread requesting the event handling
|
||||
is also the thread that's supposed to do the handling. */
|
||||
result = event->handler(event);
|
||||
@@ -693,7 +693,7 @@ PL_DequeueEvent(PLEvent* self, PLEventQueue* queue)
|
||||
client has put it in the queue, they have no idea whether it's
|
||||
been processed and destroyed or not. */
|
||||
|
||||
PR_ASSERT(queue->handlerThread == PR_CurrentThread());
|
||||
PR_ASSERT(queue->handlerThread == PR_GetCurrentThread());
|
||||
|
||||
PR_EnterMonitor(queue->monitor);
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ void abnormal_exit_handler(int signum)
|
||||
|| (signum == SIGABRT)
|
||||
)
|
||||
{
|
||||
PR_CurrentThread();
|
||||
PR_GetCurrentThread();
|
||||
printf("prog = %s\npid = %d\nsignal = %s\n",
|
||||
_progname, getpid(), strsignal(signum));
|
||||
|
||||
@@ -118,7 +118,7 @@ void abnormal_exit_handler(int signum)
|
||||
void
|
||||
ah_crap_handler(int signum)
|
||||
{
|
||||
PR_CurrentThread();
|
||||
PR_GetCurrentThread();
|
||||
|
||||
// I don't think strsignal is portable. If it is, this can be changed.
|
||||
#ifdef LINUX
|
||||
|
||||
Reference in New Issue
Block a user