Putting the lock here protects against race conditions if the ReportMsg method is called twice concurrently (which could happen if SIGUSR1 is sent at the same time Heka's internal report is being generated for the DashboardOutput). The more likely race condition, though, is that ReportMsg is executing concurrently with the rescan case in the Run method, w/ both pieces of code trying to access li.logstreamSet at the same time. To protect against that you'll need to use the lock in the rescan case as well. Really, though, it should probably be a RWMutex, w/ rescan using a write lock and ReportMsg using a read lock.