From 5a9b9d77de92117e13208d0c15bbfc120697e0b7 Mon Sep 17 00:00:00 2001 From: sb Date: Tue, 14 Dec 2010 13:30:07 +0100 Subject: sb135: #i116050# make osl_trace output atomic --- sal/osl/unx/diagnose.c | 32 +++++--------------------------- 1 file changed, 5 insertions(+), 27 deletions(-) (limited to 'sal/osl/unx/diagnose.c') diff --git a/sal/osl/unx/diagnose.c b/sal/osl/unx/diagnose.c index bb8cbca406bd..02967b3ad7f7 100644 --- a/sal/osl/unx/diagnose.c +++ b/sal/osl/unx/diagnose.c @@ -28,7 +28,6 @@ #include "osl/diagnose.h" #include "system.h" - #ifndef HAVE_DLFCN_H #if defined(LINUX) || defined(SOLARIS) @@ -58,6 +57,8 @@ #define INCLUDED_STDDEF_H #endif +#include "printtrace.h" + /************************************************************************/ /* Internal data structures and functions */ /************************************************************************/ @@ -301,32 +302,9 @@ pfunc_osl_printDetailedDebugMessage SAL_CALL osl_setDetailedDebugMessageFunc ( /************************************************************************/ /* osl_trace */ /************************************************************************/ -/* comment this define to stop output thread identifier*/ -#define OSL_TRACE_THREAD 1 -void SAL_CALL osl_trace ( - const sal_Char* lpszFormat, ...) -{ +void osl_trace(char const * pszFormat, ...) { va_list args; - -#if defined(OSL_PROFILING) - fprintf(stderr, "Time: %06lu : ", osl_getGlobalTimer() ); -#else -#if defined(OSL_TRACE_THREAD) - fprintf( - stderr, "Thread: %6lu :", - SAL_INT_CAST(unsigned long, osl_getThreadIdentifier(NULL))); -#else - fprintf(stderr, "Trace Message: "); -#endif -#endif - - va_start(args, lpszFormat); - vfprintf(stderr, lpszFormat, args); + va_start(args, pszFormat); + printTrace((unsigned long) getpid(), pszFormat, args); va_end(args); - - fprintf(stderr,"\n"); - fflush(stderr); } - -/************************************************************************/ - -- cgit