From 1af4595b5bf6776122333a9a74ee0ba748d21860 Mon Sep 17 00:00:00 2001 From: "wtc%netscape.com" Date: Tue, 7 Jan 2003 04:52:25 +0000 Subject: [PATCH] Bug 158704: PT_FPrintStats also needs to be exported (for the test programs only). Define it as a no-op in optimized builds. Deleted PT_GetStats, which is not useful. Modified files: primpl.h, nspr.def, ptio.c --- nsprpub/pr/include/private/primpl.h | 11 +++-------- nsprpub/pr/src/nspr.def | 1 + nsprpub/pr/src/pthreads/ptio.c | 11 ++++++++--- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/nsprpub/pr/include/private/primpl.h b/nsprpub/pr/include/private/primpl.h index 180c40734eb..87116e04720 100644 --- a/nsprpub/pr/include/private/primpl.h +++ b/nsprpub/pr/include/private/primpl.h @@ -219,22 +219,17 @@ typedef struct PTDebug PRUintn cvars_notified, delayed_cv_deletes; } PTDebug; -NSPR_API(void) PT_GetStats(PTDebug* here); -NSPR_API(void) PT_FPrintStats(PRFileDesc *fd, const char *msg); - #else typedef PRUintn PTDebug; -#define PT_GetStats(_p) -#define PT_FPrintStats(_fd, _msg) #endif /* defined(DEBUG) */ +NSPR_API(void) PT_FPrintStats(PRFileDesc *fd, const char *msg); + #else /* defined(_PR_PTHREADS) */ -typedef PRUintn PTDebug; -#define PT_GetStats(_p) -#define PT_FPrintStats(_fd, _msg) +NSPR_API(void) PT_FPrintStats(PRFileDesc *fd, const char *msg); /* ** This section is contains those parts needed to implement NSPR on diff --git a/nsprpub/pr/src/nspr.def b/nsprpub/pr/src/nspr.def index c4393825135..6d4b9c687ec 100644 --- a/nsprpub/pr/src/nspr.def +++ b/nsprpub/pr/src/nspr.def @@ -371,6 +371,7 @@ NSPR_4.0 { NSPRprivate { global: GetExecutionEnvironment; + PT_FPrintStats; SetExecutionEnvironment; local: *; }; diff --git a/nsprpub/pr/src/pthreads/ptio.c b/nsprpub/pr/src/pthreads/ptio.c index 8a19b91dccc..9b40a42e9ff 100644 --- a/nsprpub/pr/src/pthreads/ptio.c +++ b/nsprpub/pr/src/pthreads/ptio.c @@ -372,15 +372,13 @@ struct pt_Continuation PTDebug pt_debug; /* this is shared between several modules */ -PR_IMPLEMENT(void) PT_GetStats(PTDebug* here) { *here = pt_debug; } - PR_IMPLEMENT(void) PT_FPrintStats(PRFileDesc *debug_out, const char *msg) { PTDebug stats; char buffer[100]; PRExplodedTime tod; PRInt64 elapsed, aMil; - PT_GetStats(&stats); /* a copy */ + stats = pt_debug; /* a copy */ PR_ExplodeTime(stats.timeStarted, PR_LocalTimeParameters, &tod); (void)PR_FormatTime(buffer, sizeof(buffer), "%T", &tod); @@ -405,6 +403,13 @@ PR_IMPLEMENT(void) PT_FPrintStats(PRFileDesc *debug_out, const char *msg) stats.cvars_notified, stats.delayed_cv_deletes); } /* PT_FPrintStats */ +#else + +PR_IMPLEMENT(void) PT_FPrintStats(PRFileDesc *debug_out, const char *msg) +{ + /* do nothing */ +} /* PT_FPrintStats */ + #endif /* DEBUG */ #if defined(_PR_POLL_WITH_SELECT)