[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Logger updated for thread-safety



Hello,

please check out the new Logger class (QE/logger.h .cpp) from CVS. It
has been updated to be threadsafe.

I was using ctime(), but that function cannot be used in multithreaded
programs. The Logger class now uses ctime_r(), the threadsafe version of
ctime(), instead.
There is thread syncronization in Logger, but ctime() was called in an
unprotected area. The Logger object can now safely be use from several
threads concurrently.

Make sure you are using only one instance of the Logger object per
log-file. (Syncronization is instance specific.)

Regards, Henrik 
_________________________________________
Henrik Nordberg       <hnordberg@lbl.gov>
Scientific Data Management Research Group
Lawrence Berkeley National Laboratory