Sunday, October 7, 2001 09:42 PM
Logger logger = new Logger();
ThreadA threadA = new ThreadA(logger);
ThreadA threadB = new ThreadB(logger);
this way, both threads refer to the same logging object.
You can call logger.log() from either thread.
the Logger.log() method should be synchronized to avoid both threads trying to do a log at the same time.