glog: EnableLogCleaner() interface is not thread safe?

I read the functions of EnableLogCleanerDisableLogCleaner and LogCleaner::enabled().

I find the private member enabled_ of LogCleaner is not lock guard.

Once one thread call EnableLogCleaner,and other thread is logging, It may lead to undefined behaviour?

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 16 (4 by maintainers)

Most upvoted comments

A possible optimization strategy: use CycleClock_Now() to maintain an additional timer such as next_cleanup_time_ .

About the log cleaner performance, I shared the same opnion with issue #702 . Much performance cost when enable log clean.

What’s exactly “much performance” in absolute numbers? Issue #702 did not provide any details either. Therefore I don’t see any factual arguments.