From 4e404673b69a7e2772579788a0b55c7037cee314 Mon Sep 17 00:00:00 2001 From: jhurst Date: Sat, 9 Aug 2008 01:09:50 +0000 Subject: The following changes have been checked into napali: 1. The is some template voodoo in KM_fileio.h to ward off the D_FILE_OFFSET_BITS=64 bug 2. KM_log.cpp now uses mutex protection for the global default LogSink 3. I added Kumu::Version (uses the same value as ASDCP::Version()). I did this because... 4. I modified Makefile.am so that kmfilegen, kmrandgen, and kmuuidgen only link against libkumu, as nature intended. --- src/KM_log.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/KM_log.cpp') diff --git a/src/KM_log.cpp b/src/KM_log.cpp index aa0303b..3d34f1c 100755 --- a/src/KM_log.cpp +++ b/src/KM_log.cpp @@ -31,6 +31,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include +#include #include #include #include @@ -58,20 +59,24 @@ Kumu::ILogSink::vLogf(LogType_t type, const char* fmt, va_list* list) //------------------------------------------------------------------------------------------ // -static Kumu::ILogSink* s_DefaultLogSink; +static Kumu::Mutex s_DefaultLogSinkLock; +static Kumu::ILogSink* s_DefaultLogSink = 0; static Kumu::StdioLogSink s_StderrLogSink; // void Kumu::SetDefaultLogSink(ILogSink* Sink) { - s_DefaultLogSink = Sink; + AutoMutex L(s_DefaultLogSinkLock); + s_DefaultLogSink = Sink; } // Returns the internal default sink. Kumu::ILogSink& Kumu::DefaultLogSink() { + AutoMutex L(s_DefaultLogSinkLock); + if ( s_DefaultLogSink == 0 ) s_DefaultLogSink = &s_StderrLogSink; -- cgit v1.2.3