diff options
-rw-r--r-- | pr/include/private/primpl.h | 15 | ||||
-rw-r--r-- | pr/src/io/prio.c | 9 | ||||
-rw-r--r-- | pr/src/nspr.def | 1 | ||||
-rw-r--r-- | pr/src/pthreads/ptio.c | 11 |
4 files changed, 21 insertions, 15 deletions
diff --git a/pr/include/private/primpl.h b/pr/include/private/primpl.h index b3bf72d2..629aae33 100644 --- a/pr/include/private/primpl.h +++ b/pr/include/private/primpl.h @@ -216,22 +216,13 @@ 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/pr/src/io/prio.c b/pr/src/io/prio.c index ce5c021b..ea762a40 100644 --- a/pr/src/io/prio.c +++ b/pr/src/io/prio.c @@ -167,3 +167,12 @@ PR_IMPLEMENT(PRStatus) PR_SetFDInheritable( return PR_FAILURE; #endif } + +/* +** This function only has a useful implementation in the debug build of +** the pthreads version. +*/ +PR_IMPLEMENT(void) PT_FPrintStats(PRFileDesc *debug_out, const char *msg) +{ + /* do nothing */ +} /* PT_FPrintStats */ diff --git a/pr/src/nspr.def b/pr/src/nspr.def index c4393825..6d4b9c68 100644 --- a/pr/src/nspr.def +++ b/pr/src/nspr.def @@ -371,6 +371,7 @@ NSPR_4.0 { NSPRprivate { global: GetExecutionEnvironment; + PT_FPrintStats; SetExecutionEnvironment; local: *; }; diff --git a/pr/src/pthreads/ptio.c b/pr/src/pthreads/ptio.c index 175476ce..f61889ec 100644 --- a/pr/src/pthreads/ptio.c +++ b/pr/src/pthreads/ptio.c @@ -343,15 +343,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); @@ -376,6 +374,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) |