From 81329f10b85607dd6f622b7fd663c7e7134910dd Mon Sep 17 00:00:00 2001 From: "wtchang%redhat.com" Date: Mon, 7 Nov 2005 22:39:09 +0000 Subject: [PATCH] Bugzilla Bug 156633: replaced the deprecated PR_CurrentThread by PR_GetCurrentThread. The patch is contributed by Tim . r=wtc. Modified Files: prmsgc.c btthread.c rcthread.cpp mdmac.c prthinfo.c ptio.c ptsynch.c ptthread.c cltsrv.c intrupt.c perf.c provider.c git-svn-id: svn://10.0.0.236/trunk@184272 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/nsprpub/lib/msgc/src/prmsgc.c | 2 +- mozilla/nsprpub/pr/src/bthreads/btthread.c | 2 +- mozilla/nsprpub/pr/src/cplus/rcthread.cpp | 4 +- mozilla/nsprpub/pr/src/md/mac/mdmac.c | 2 +- mozilla/nsprpub/pr/src/misc/prthinfo.c | 2 +- mozilla/nsprpub/pr/src/pthreads/ptio.c | 2 +- mozilla/nsprpub/pr/src/pthreads/ptsynch.c | 2 +- mozilla/nsprpub/pr/src/pthreads/ptthread.c | 20 ++++----- mozilla/nsprpub/pr/tests/cltsrv.c | 48 +++++++++++----------- mozilla/nsprpub/pr/tests/intrupt.c | 4 +- mozilla/nsprpub/pr/tests/perf.c | 2 +- mozilla/nsprpub/pr/tests/provider.c | 48 +++++++++++----------- 12 files changed, 69 insertions(+), 69 deletions(-) diff --git a/mozilla/nsprpub/lib/msgc/src/prmsgc.c b/mozilla/nsprpub/lib/msgc/src/prmsgc.c index ad0566a40e0..a6fc897ac36 100644 --- a/mozilla/nsprpub/lib/msgc/src/prmsgc.c +++ b/mozilla/nsprpub/lib/msgc/src/prmsgc.c @@ -2288,7 +2288,7 @@ pr_TraceRootPointer(PRWord *p, void* data) printTrace = 1; } else { - if (PR_StackSpaceLeft(PR_CurrentThread()) < 512) { + if (PR_StackSpaceLeft(PR_GetCurrentThread()) < 512) { fprintf(out, "\n### Path too deep (giving up):\n"); printTrace = 1; } diff --git a/mozilla/nsprpub/pr/src/bthreads/btthread.c b/mozilla/nsprpub/pr/src/bthreads/btthread.c index 814ede290f7..33bdfcc70e7 100644 --- a/mozilla/nsprpub/pr/src/bthreads/btthread.c +++ b/mozilla/nsprpub/pr/src/bthreads/btthread.c @@ -618,7 +618,7 @@ PR_IMPLEMENT(PRStatus) PR_IMPLEMENT(PRStatus) PR_Cleanup () { - PRThread *me = PR_CurrentThread(); + PRThread *me = PR_GetCurrentThread(); PR_ASSERT(me->state & BT_THREAD_PRIMORD); if ((me->state & BT_THREAD_PRIMORD) == 0) { diff --git a/mozilla/nsprpub/pr/src/cplus/rcthread.cpp b/mozilla/nsprpub/pr/src/cplus/rcthread.cpp index 10a7ce928de..25a9810fecf 100755 --- a/mozilla/nsprpub/pr/src/cplus/rcthread.cpp +++ b/mozilla/nsprpub/pr/src/cplus/rcthread.cpp @@ -73,7 +73,7 @@ RCThread::RCThread( execution = ex_unstarted; identity = PR_CreateThread( PR_USER_THREAD, nas_Root, this, - PR_GetThreadPriority(PR_CurrentThread()), + PR_GetThreadPriority(PR_GetCurrentThread()), (PRThreadScope)scope, (PRThreadState)join, stackSize); } /* RCThread::RCThread */ @@ -132,7 +132,7 @@ void RCThread::SetPriority(RCThread::Priority new_priority) { PR_SetThreadPriority(identity, (PRThreadPriority)new_priority); } PRThread *RCThread::Self() - { return PR_CurrentThread(); } + { return PR_GetCurrentThread(); } RCThread::Scope RCThread::GetScope() const { return (RCThread::Scope)PR_GetThreadScope(identity); } diff --git a/mozilla/nsprpub/pr/src/md/mac/mdmac.c b/mozilla/nsprpub/pr/src/md/mac/mdmac.c index bcbb3f8293c..cda67fb78e2 100644 --- a/mozilla/nsprpub/pr/src/md/mac/mdmac.c +++ b/mozilla/nsprpub/pr/src/md/mac/mdmac.c @@ -103,7 +103,7 @@ pascal long StackSpacePatch(UInt16 trapNo) char tos; PRThread *thisThread; - thisThread = PR_CurrentThread(); + thisThread = PR_GetCurrentThread(); // If we are the primary thread, then call through to the // good ol' fashion stack space implementation. Otherwise, diff --git a/mozilla/nsprpub/pr/src/misc/prthinfo.c b/mozilla/nsprpub/pr/src/misc/prthinfo.c index 25cbd185794..76c44888461 100644 --- a/mozilla/nsprpub/pr/src/misc/prthinfo.c +++ b/mozilla/nsprpub/pr/src/misc/prthinfo.c @@ -194,7 +194,7 @@ PR_ScanStackPointers(PRScanStackFun scanFun, void* scanClosure) PR_IMPLEMENT(PRUword) PR_GetStackSpaceLeft(PRThread* t) { - PRThread *current = PR_CurrentThread(); + PRThread *current = PR_GetCurrentThread(); PRWord *sp, *esp; int stack_end; diff --git a/mozilla/nsprpub/pr/src/pthreads/ptio.c b/mozilla/nsprpub/pr/src/pthreads/ptio.c index 7a4ce96fb71..e34e8aa2ffd 100644 --- a/mozilla/nsprpub/pr/src/pthreads/ptio.c +++ b/mozilla/nsprpub/pr/src/pthreads/ptio.c @@ -1219,7 +1219,7 @@ PR_IMPLEMENT(PRFileDesc*) PR_GetSpecialFD(PRSpecialFD osfd) static PRBool pt_TestAbort(void) { - PRThread *me = PR_CurrentThread(); + PRThread *me = PR_GetCurrentThread(); if(_PT_THREAD_INTERRUPTED(me)) { PR_SetError(PR_PENDING_INTERRUPT_ERROR, 0); diff --git a/mozilla/nsprpub/pr/src/pthreads/ptsynch.c b/mozilla/nsprpub/pr/src/pthreads/ptsynch.c index cc8bb1b057c..bd0688c2c90 100644 --- a/mozilla/nsprpub/pr/src/pthreads/ptsynch.c +++ b/mozilla/nsprpub/pr/src/pthreads/ptsynch.c @@ -369,7 +369,7 @@ PR_IMPLEMENT(void) PR_DestroyCondVar(PRCondVar *cvar) PR_IMPLEMENT(PRStatus) PR_WaitCondVar(PRCondVar *cvar, PRIntervalTime timeout) { PRIntn rv; - PRThread *thred = PR_CurrentThread(); + PRThread *thred = PR_GetCurrentThread(); PR_ASSERT(cvar != NULL); /* We'd better be locked */ diff --git a/mozilla/nsprpub/pr/src/pthreads/ptthread.c b/mozilla/nsprpub/pr/src/pthreads/ptthread.c index c8b41c11f86..3a8303aec06 100644 --- a/mozilla/nsprpub/pr/src/pthreads/ptthread.c +++ b/mozilla/nsprpub/pr/src/pthreads/ptthread.c @@ -739,19 +739,19 @@ PR_IMPLEMENT(PRStatus) PR_Interrupt(PRThread *thred) PR_IMPLEMENT(void) PR_ClearInterrupt(void) { - PRThread *me = PR_CurrentThread(); + PRThread *me = PR_GetCurrentThread(); me->state &= ~PT_THREAD_ABORTED; } /* PR_ClearInterrupt */ PR_IMPLEMENT(void) PR_BlockInterrupt(void) { - PRThread *me = PR_CurrentThread(); + PRThread *me = PR_GetCurrentThread(); _PT_THREAD_BLOCK_INTERRUPT(me); } /* PR_BlockInterrupt */ PR_IMPLEMENT(void) PR_UnblockInterrupt(void) { - PRThread *me = PR_CurrentThread(); + PRThread *me = PR_GetCurrentThread(); _PT_THREAD_UNBLOCK_INTERRUPT(me); } /* PR_UnblockInterrupt */ @@ -926,7 +926,7 @@ void _PR_InitThreads( PR_IMPLEMENT(PRStatus) PR_Cleanup(void) { - PRThread *me = PR_CurrentThread(); + PRThread *me = PR_GetCurrentThread(); int rv; PR_LOG(_pr_thread_lm, PR_LOG_MIN, ("PR_Cleanup: shutting down NSPR")); PR_ASSERT(me->state & PT_THREAD_PRIMORD); @@ -1093,14 +1093,14 @@ static void init_pthread_gc_support(void) PR_IMPLEMENT(void) PR_SetThreadGCAble(void) { PR_Lock(pt_book.ml); - PR_CurrentThread()->state |= PT_THREAD_GCABLE; + PR_GetCurrentThread()->state |= PT_THREAD_GCABLE; PR_Unlock(pt_book.ml); } PR_IMPLEMENT(void) PR_ClearThreadGCAble(void) { PR_Lock(pt_book.ml); - PR_CurrentThread()->state &= (~PT_THREAD_GCABLE); + PR_GetCurrentThread()->state &= (~PT_THREAD_GCABLE); PR_Unlock(pt_book.ml); } @@ -1115,7 +1115,7 @@ PR_IMPLEMENT(PRStatus) PR_EnumerateThreads(PREnumerator func, void *arg) PRIntn count = 0; PRStatus rv = PR_SUCCESS; PRThread* thred = pt_book.first; - PRThread *me = PR_CurrentThread(); + PRThread *me = PR_GetCurrentThread(); PR_LOG(_pr_gc_lm, PR_LOG_ALWAYS, ("Begin PR_EnumerateThreads\n")); /* @@ -1202,7 +1202,7 @@ static void null_signal_handler(PRIntn sig) static void suspend_signal_handler(PRIntn sig) { - PRThread *me = PR_CurrentThread(); + PRThread *me = PR_GetCurrentThread(); PR_ASSERT(me != NULL); PR_ASSERT(_PT_IS_GCABLE_THREAD(me)); @@ -1381,7 +1381,7 @@ PR_IMPLEMENT(void) PR_SuspendAll(void) PRIntervalTime stime, etime; #endif PRThread* thred = pt_book.first; - PRThread *me = PR_CurrentThread(); + PRThread *me = PR_GetCurrentThread(); int rv; rv = pthread_once(&pt_gc_support_control, init_pthread_gc_support); @@ -1427,7 +1427,7 @@ PR_IMPLEMENT(void) PR_ResumeAll(void) PRIntervalTime stime, etime; #endif PRThread* thred = pt_book.first; - PRThread *me = PR_CurrentThread(); + PRThread *me = PR_GetCurrentThread(); PR_LOG(_pr_gc_lm, PR_LOG_ALWAYS, ("Begin PR_ResumeAll\n")); /* * Resume all previously suspended GC able threads. diff --git a/mozilla/nsprpub/pr/tests/cltsrv.c b/mozilla/nsprpub/pr/tests/cltsrv.c index 9602784357d..022c634a864 100644 --- a/mozilla/nsprpub/pr/tests/cltsrv.c +++ b/mozilla/nsprpub/pr/tests/cltsrv.c @@ -245,7 +245,7 @@ static void PR_CALLBACK Client(void *arg) char buffer[1024]; PRFileDesc *fd = NULL; PRUintn clipping = DEFAULT_CLIPPING; - PRThread *me = PR_CurrentThread(); + PRThread *me = PR_GetCurrentThread(); CSClient_t *client = (CSClient_t*)arg; CSDescriptor_t *descriptor = PR_NEW(CSDescriptor_t); PRIntervalTime timeout = PR_MillisecondsToInterval(DEFAULT_CLIENT_TIMEOUT); @@ -365,7 +365,7 @@ static void PR_CALLBACK Client(void *arg) TEST_LOG( cltsrv_log_file, TEST_LOG_ERROR, ("\t\tClient(0x%p): unexpected end of stream\n", - PR_CurrentThread())); + PR_GetCurrentThread())); break; } filebytes += bytes; @@ -402,7 +402,7 @@ aborted: TEST_LOG( cltsrv_log_file, TEST_LOG_ALWAYS, ("\tClient(0x%p): stopped after %u operations and %u bytes\n", - PR_CurrentThread(), client->operations, client->bytesTransferred)); + PR_GetCurrentThread(), client->operations, client->bytesTransferred)); } /* Client */ @@ -411,7 +411,7 @@ static PRStatus ProcessRequest(PRFileDesc *fd, CSServer_t *server) PRStatus drv, rv; char buffer[1024]; PRFileDesc *file = NULL; - PRThread * me = PR_CurrentThread(); + PRThread * me = PR_GetCurrentThread(); PRInt32 bytes, descbytes, netbytes, filebytes = 0; CSDescriptor_t *descriptor = PR_NEW(CSDescriptor_t); PRIntervalTime timeout = PR_MillisecondsToInterval(DEFAULT_SERVER_TIMEOUT); @@ -551,7 +551,7 @@ static PRStatus ProcessRequest(PRFileDesc *fd, CSServer_t *server) TEST_LOG( cltsrv_log_file, TEST_LOG_ERROR, ("\t\tProcessRequest(0x%p): open file timeout\n", - PR_CurrentThread())); + PR_GetCurrentThread())); goto aborted; } TEST_LOG( @@ -657,7 +657,7 @@ static PRStatus CreateWorker(CSServer_t *server, CSPool_t *pool) TEST_LOG(cltsrv_log_file, TEST_LOG_STATUS, ("\tCreateWorker(0x%p): create new worker (0x%p)\n", - PR_CurrentThread(), worker->thread)); + PR_GetCurrentThread(), worker->thread)); return PR_SUCCESS; } /* CreateWorker */ @@ -667,7 +667,7 @@ static void PR_CALLBACK Worker(void *arg) PRStatus rv; PRNetAddr from; PRFileDesc *fd = NULL; - PRThread *me = PR_CurrentThread(); + PRThread *me = PR_GetCurrentThread(); CSWorker_t *worker = (CSWorker_t*)arg; CSServer_t *server = worker->server; CSPool_t *pool = &server->pool; @@ -764,7 +764,7 @@ exit: TEST_LOG( cltsrv_log_file, TEST_LOG_NOTICE, - ("\t\tWorker(0x%p): exiting [%u]\n", PR_CurrentThread(), pool->workers)); + ("\t\tWorker(0x%p): exiting [%u]\n", PR_GetCurrentThread(), pool->workers)); PR_Lock(server->ml); pool->workers -= 1; /* undefine our existance */ @@ -780,7 +780,7 @@ static void PR_CALLBACK Server(void *arg) { PRStatus rv; PRNetAddr serverAddress; - PRThread *me = PR_CurrentThread(); + PRThread *me = PR_GetCurrentThread(); CSServer_t *server = (CSServer_t*)arg; PRSocketOptionData sockOpt; @@ -1028,7 +1028,7 @@ PRIntn main(PRIntn argc, char** argv) if (workersMin > accepting) accepting = workersMin; PR_STDIO_INIT(); - TimeOfDayMessage("Client/Server started at", PR_CurrentThread()); + TimeOfDayMessage("Client/Server started at", PR_GetCurrentThread()); cltsrv_log_file = PR_NewLogModule("cltsrv_log"); MY_ASSERT(NULL != cltsrv_log_file); @@ -1047,7 +1047,7 @@ PRIntn main(PRIntn argc, char** argv) /* Establish the server */ TEST_LOG( cltsrv_log_file, TEST_LOG_INFO, - ("main(0x%p): starting server\n", PR_CurrentThread())); + ("main(0x%p): starting server\n", PR_GetCurrentThread())); server = PR_NEWZAP(CSServer_t); PR_INIT_CLIST(&server->list); @@ -1064,7 +1064,7 @@ PRIntn main(PRIntn argc, char** argv) TEST_LOG( cltsrv_log_file, TEST_LOG_NOTICE, - ("main(0x%p): creating server thread\n", PR_CurrentThread())); + ("main(0x%p): creating server thread\n", PR_GetCurrentThread())); server->thread = PR_CreateThread( PR_USER_THREAD, Server, server, PR_PRIORITY_HIGH, @@ -1073,7 +1073,7 @@ PRIntn main(PRIntn argc, char** argv) TEST_LOG( cltsrv_log_file, TEST_LOG_VERBOSE, - ("main(0x%p): waiting for server init\n", PR_CurrentThread())); + ("main(0x%p): waiting for server init\n", PR_GetCurrentThread())); PR_Lock(server->ml); while (server->state == cs_init) @@ -1083,7 +1083,7 @@ PRIntn main(PRIntn argc, char** argv) TEST_LOG( cltsrv_log_file, TEST_LOG_VERBOSE, ("main(0x%p): server init complete (port #%d)\n", - PR_CurrentThread(), server->port)); + PR_GetCurrentThread(), server->port)); } if (clients != 0) @@ -1096,7 +1096,7 @@ PRIntn main(PRIntn argc, char** argv) TEST_LOG( cltsrv_log_file, TEST_LOG_VERBOSE, ("main(0x%p): creating %d client threads\n", - PR_CurrentThread(), clients)); + PR_GetCurrentThread(), clients)); if (!serverIsLocal) { @@ -1130,7 +1130,7 @@ PRIntn main(PRIntn argc, char** argv) client[index].stateChange = PR_NewCondVar(client[index].ml); TEST_LOG( cltsrv_log_file, TEST_LOG_INFO, - ("main(0x%p): creating client threads\n", PR_CurrentThread())); + ("main(0x%p): creating client threads\n", PR_GetCurrentThread())); client[index].thread = PR_CreateThread( PR_USER_THREAD, Client, &client[index], PR_PRIORITY_NORMAL, thread_scope, PR_JOINABLE_THREAD, 0); @@ -1146,11 +1146,11 @@ PRIntn main(PRIntn argc, char** argv) TEST_LOG( cltsrv_log_file, TEST_LOG_ALWAYS, ("main(0x%p): waiting for execution interval (%d seconds)\n", - PR_CurrentThread(), execution)); + PR_GetCurrentThread(), execution)); WaitForCompletion(execution); - TimeOfDayMessage("Shutting down", PR_CurrentThread()); + TimeOfDayMessage("Shutting down", PR_GetCurrentThread()); if (clients != 0) { @@ -1158,7 +1158,7 @@ PRIntn main(PRIntn argc, char** argv) { TEST_LOG(cltsrv_log_file, TEST_LOG_STATUS, ("main(0x%p): notifying client(0x%p) to stop\n", - PR_CurrentThread(), client[index].thread)); + PR_GetCurrentThread(), client[index].thread)); PR_Lock(client[index].ml); if (cs_run == client[index].state) @@ -1173,7 +1173,7 @@ PRIntn main(PRIntn argc, char** argv) TEST_LOG(cltsrv_log_file, TEST_LOG_VERBOSE, ("main(0x%p): joining client(0x%p)\n", - PR_CurrentThread(), client[index].thread)); + PR_GetCurrentThread(), client[index].thread)); joinStatus = PR_JoinThread(client[index].thread); TEST_ASSERT(PR_SUCCESS == joinStatus); @@ -1189,7 +1189,7 @@ PRIntn main(PRIntn argc, char** argv) TEST_LOG( cltsrv_log_file, TEST_LOG_NOTICE, ("main(0x%p): notifying server(0x%p) to stop\n", - PR_CurrentThread(), server->thread)); + PR_GetCurrentThread(), server->thread)); PR_Lock(server->ml); server->state = cs_stop; @@ -1201,7 +1201,7 @@ PRIntn main(PRIntn argc, char** argv) TEST_LOG( cltsrv_log_file, TEST_LOG_NOTICE, ("main(0x%p): joining server(0x%p)\n", - PR_CurrentThread(), server->thread)); + PR_GetCurrentThread(), server->thread)); joinStatus = PR_JoinThread(server->thread); TEST_ASSERT(PR_SUCCESS == joinStatus); @@ -1214,11 +1214,11 @@ PRIntn main(PRIntn argc, char** argv) TEST_LOG( cltsrv_log_file, TEST_LOG_ALWAYS, - ("main(0x%p): test complete\n", PR_CurrentThread())); + ("main(0x%p): test complete\n", PR_GetCurrentThread())); PT_FPrintStats(debug_out, "\nPThread Statistics\n"); - TimeOfDayMessage("Test exiting at", PR_CurrentThread()); + TimeOfDayMessage("Test exiting at", PR_GetCurrentThread()); PR_Cleanup(); return 0; } /* main */ diff --git a/mozilla/nsprpub/pr/tests/intrupt.c b/mozilla/nsprpub/pr/tests/intrupt.c index f6f3810514f..a4d62f7734f 100644 --- a/mozilla/nsprpub/pr/tests/intrupt.c +++ b/mozilla/nsprpub/pr/tests/intrupt.c @@ -73,7 +73,7 @@ static PRThreadScope thread_scope = PR_LOCAL_THREAD; static void PR_CALLBACK AbortCV(void *arg) { PRStatus rv; - PRThread *me = PR_CurrentThread(); + PRThread *me = PR_GetCurrentThread(); /* some other thread (main) is doing the interrupt */ PR_Lock(ml); @@ -292,7 +292,7 @@ void PR_CALLBACK Intrupt(void *arg) if (debug_mode) printf("Part III\n"); setup_listen_socket(&listner, &netaddr); abortIO = PR_CreateThread( - PR_USER_THREAD, AbortIO, PR_CurrentThread(), PR_PRIORITY_NORMAL, + PR_USER_THREAD, AbortIO, PR_GetCurrentThread(), PR_PRIORITY_NORMAL, thread_scope, PR_JOINABLE_THREAD, 0); if (PR_Accept(listner, &netaddr, PR_INTERVAL_NO_TIMEOUT) == NULL) diff --git a/mozilla/nsprpub/pr/tests/perf.c b/mozilla/nsprpub/pr/tests/perf.c index edd3a6efaeb..dda696820b4 100644 --- a/mozilla/nsprpub/pr/tests/perf.c +++ b/mozilla/nsprpub/pr/tests/perf.c @@ -79,7 +79,7 @@ static void DLLProcedureCall(void) { PRInt32 i; PRThreadState state; - PRThread *self = PR_CurrentThread(); + PRThread *self = PR_GetCurrentThread(); for (i = 0; i < count; i++) { state = PR_GetThreadState(self); diff --git a/mozilla/nsprpub/pr/tests/provider.c b/mozilla/nsprpub/pr/tests/provider.c index 7b8113b374f..ab3ff72478a 100644 --- a/mozilla/nsprpub/pr/tests/provider.c +++ b/mozilla/nsprpub/pr/tests/provider.c @@ -248,7 +248,7 @@ static void PR_CALLBACK Client(void *arg) PRFileDesc *fd = NULL; PRUintn clipping = DEFAULT_CLIPPING; CSClient_t *client = (CSClient_t*)arg; - PRThread *me = client->thread = PR_CurrentThread(); + PRThread *me = client->thread = PR_GetCurrentThread(); CSDescriptor_t *descriptor = PR_NEW(CSDescriptor_t); PRIntervalTime timeout = PR_MillisecondsToInterval(DEFAULT_CLIENT_TIMEOUT); @@ -366,7 +366,7 @@ static void PR_CALLBACK Client(void *arg) TEST_LOG( cltsrv_log_file, TEST_LOG_ERROR, ("\t\tClient(0x%p): unexpected end of stream\n", - PR_CurrentThread())); + PR_GetCurrentThread())); break; } filebytes += bytes; @@ -403,7 +403,7 @@ aborted: TEST_LOG( cltsrv_log_file, TEST_LOG_ALWAYS, ("\tClient(0x%p): stopped after %u operations and %u bytes\n", - PR_CurrentThread(), client->operations, client->bytesTransferred)); + PR_GetCurrentThread(), client->operations, client->bytesTransferred)); } /* Client */ @@ -412,7 +412,7 @@ static PRStatus ProcessRequest(PRFileDesc *fd, CSServer_t *server) PRStatus drv, rv; char buffer[1024]; PRFileDesc *file = NULL; - PRThread * me = PR_CurrentThread(); + PRThread * me = PR_GetCurrentThread(); PRInt32 bytes, descbytes, netbytes, filebytes = 0; CSDescriptor_t *descriptor = PR_NEW(CSDescriptor_t); PRIntervalTime timeout = PR_MillisecondsToInterval(DEFAULT_SERVER_TIMEOUT); @@ -551,7 +551,7 @@ static PRStatus ProcessRequest(PRFileDesc *fd, CSServer_t *server) TEST_LOG( cltsrv_log_file, TEST_LOG_ERROR, ("\t\tProcessRequest(0x%p): open file timeout\n", - PR_CurrentThread())); + PR_GetCurrentThread())); goto aborted; } TEST_LOG( @@ -864,7 +864,7 @@ static PRStatus CreateWorker(CSServer_t *server, CSPool_t *pool) TEST_LOG(cltsrv_log_file, TEST_LOG_STATUS, ("\tCreateWorker(0x%p): create new worker (0x%p)\n", - PR_CurrentThread(), worker->thread)); + PR_GetCurrentThread(), worker->thread)); return rv; } /* CreateWorker */ @@ -878,7 +878,7 @@ static void PR_CALLBACK Worker(void *arg) CSServer_t *server = worker->server; CSPool_t *pool = &server->pool; - PRThread *me = worker->thread = PR_CurrentThread(); + PRThread *me = worker->thread = PR_GetCurrentThread(); TEST_LOG( cltsrv_log_file, TEST_LOG_NOTICE, @@ -972,7 +972,7 @@ exit: TEST_LOG( cltsrv_log_file, TEST_LOG_NOTICE, - ("\t\tWorker(0x%p): exiting [%u]\n", PR_CurrentThread(), pool->workers)); + ("\t\tWorker(0x%p): exiting [%u]\n", PR_GetCurrentThread(), pool->workers)); PR_Lock(server->ml); pool->workers -= 1; /* undefine our existance */ @@ -989,7 +989,7 @@ static void PR_CALLBACK Server(void *arg) PRStatus rv; PRNetAddr serverAddress; CSServer_t *server = (CSServer_t*)arg; - PRThread *me = server->thread = PR_CurrentThread(); + PRThread *me = server->thread = PR_GetCurrentThread(); PRSocketOptionData sockOpt; server->listener = PR_Socket(domain, SOCK_STREAM, protocol); @@ -1243,7 +1243,7 @@ PRIntn main(PRIntn argc, char** argv) if (workersMin > accepting) accepting = workersMin; PR_STDIO_INIT(); - TimeOfDayMessage("Client/Server started at", PR_CurrentThread()); + TimeOfDayMessage("Client/Server started at", PR_GetCurrentThread()); cltsrv_log_file = PR_NewLogModule("cltsrv_log"); MY_ASSERT(NULL != cltsrv_log_file); @@ -1259,7 +1259,7 @@ PRIntn main(PRIntn argc, char** argv) /* Establish the server */ TEST_LOG( cltsrv_log_file, TEST_LOG_INFO, - ("main(0x%p): starting server\n", PR_CurrentThread())); + ("main(0x%p): starting server\n", PR_GetCurrentThread())); server = PR_NEWZAP(CSServer_t); PR_INIT_CLIST(&server->list); @@ -1276,7 +1276,7 @@ PRIntn main(PRIntn argc, char** argv) TEST_LOG( cltsrv_log_file, TEST_LOG_NOTICE, - ("main(0x%p): creating server thread\n", PR_CurrentThread())); + ("main(0x%p): creating server thread\n", PR_GetCurrentThread())); rv = NewThread( Server, server, PR_PRIORITY_HIGH, PR_JOINABLE_THREAD); @@ -1284,7 +1284,7 @@ PRIntn main(PRIntn argc, char** argv) TEST_LOG( cltsrv_log_file, TEST_LOG_VERBOSE, - ("main(0x%p): waiting for server init\n", PR_CurrentThread())); + ("main(0x%p): waiting for server init\n", PR_GetCurrentThread())); PR_Lock(server->ml); while (server->state == cs_init) @@ -1294,7 +1294,7 @@ PRIntn main(PRIntn argc, char** argv) TEST_LOG( cltsrv_log_file, TEST_LOG_VERBOSE, ("main(0x%p): server init complete (port #%d)\n", - PR_CurrentThread(), server->port)); + PR_GetCurrentThread(), server->port)); } if (clients != 0) @@ -1307,7 +1307,7 @@ PRIntn main(PRIntn argc, char** argv) TEST_LOG( cltsrv_log_file, TEST_LOG_VERBOSE, ("main(0x%p): creating %d client threads\n", - PR_CurrentThread(), clients)); + PR_GetCurrentThread(), clients)); if (!serverIsLocal) { @@ -1337,7 +1337,7 @@ PRIntn main(PRIntn argc, char** argv) client[index].stateChange = PR_NewCondVar(client[index].ml); TEST_LOG( cltsrv_log_file, TEST_LOG_INFO, - ("main(0x%p): creating client threads\n", PR_CurrentThread())); + ("main(0x%p): creating client threads\n", PR_GetCurrentThread())); rv = NewThread( Client, &client[index], PR_PRIORITY_NORMAL, PR_JOINABLE_THREAD); TEST_ASSERT(PR_SUCCESS == rv); @@ -1352,11 +1352,11 @@ PRIntn main(PRIntn argc, char** argv) TEST_LOG( cltsrv_log_file, TEST_LOG_ALWAYS, ("main(0x%p): waiting for execution interval (%d seconds)\n", - PR_CurrentThread(), execution)); + PR_GetCurrentThread(), execution)); WaitForCompletion(execution); - TimeOfDayMessage("Shutting down", PR_CurrentThread()); + TimeOfDayMessage("Shutting down", PR_GetCurrentThread()); if (clients != 0) { @@ -1364,7 +1364,7 @@ PRIntn main(PRIntn argc, char** argv) { TEST_LOG(cltsrv_log_file, TEST_LOG_STATUS, ("main(0x%p): notifying client(0x%p) to stop\n", - PR_CurrentThread(), client[index].thread)); + PR_GetCurrentThread(), client[index].thread)); PR_Lock(client[index].ml); if (cs_run == client[index].state) @@ -1379,7 +1379,7 @@ PRIntn main(PRIntn argc, char** argv) TEST_LOG(cltsrv_log_file, TEST_LOG_VERBOSE, ("main(0x%p): joining client(0x%p)\n", - PR_CurrentThread(), client[index].thread)); + PR_GetCurrentThread(), client[index].thread)); joinStatus = JoinThread(client[index].thread); TEST_ASSERT(PR_SUCCESS == joinStatus); @@ -1395,7 +1395,7 @@ PRIntn main(PRIntn argc, char** argv) TEST_LOG( cltsrv_log_file, TEST_LOG_NOTICE, ("main(0x%p): notifying server(0x%p) to stop\n", - PR_CurrentThread(), server->thread)); + PR_GetCurrentThread(), server->thread)); PR_Lock(server->ml); server->state = cs_stop; @@ -1407,7 +1407,7 @@ PRIntn main(PRIntn argc, char** argv) TEST_LOG( cltsrv_log_file, TEST_LOG_NOTICE, ("main(0x%p): joining server(0x%p)\n", - PR_CurrentThread(), server->thread)); + PR_GetCurrentThread(), server->thread)); joinStatus = JoinThread(server->thread); TEST_ASSERT(PR_SUCCESS == joinStatus); @@ -1420,7 +1420,7 @@ PRIntn main(PRIntn argc, char** argv) TEST_LOG( cltsrv_log_file, TEST_LOG_ALWAYS, - ("main(0x%p): test complete\n", PR_CurrentThread())); + ("main(0x%p): test complete\n", PR_GetCurrentThread())); if (thread_provider == thread_win32) thread_type = "\nWin32 Thread Statistics\n"; @@ -1437,7 +1437,7 @@ PRIntn main(PRIntn argc, char** argv) PT_FPrintStats(debug_out, thread_type); - TimeOfDayMessage("Test exiting at", PR_CurrentThread()); + TimeOfDayMessage("Test exiting at", PR_GetCurrentThread()); PR_Cleanup(); return 0; } /* main */