You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-user@logging.apache.org by Frank Sun <fs...@yahoo.com> on 2005/07/11 18:26:39 UTC

Is the mutex used in AsyncAppender::close() wrong?

In following code,

synchronized sync(mutex);
aai->removeAllAppenders();

mutex is for append and dispatch threads to access rotate buffer.

And the mutex to protect adding and removing appenders from asyncappender is
aai->getMutex()

I removed above two lines and simple call removeAllAppenders(), which will call

synchronized sync(aai->getMutex());
aai->removeAllAppenders();

then resolve one dead lock problem. 

Is my approch correct?

Arnold, please declare the member functions virtual if possible, such as in
loggingevent class. why do you declare synchronize as not exportable? 

Thanks,

Frank