Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
in_tail: Prevent the thread-unsafe method from being called concurrently
Essentially there is a concurrency bug in the implementation of `in_tail`. While `IOHandler` is not designed to be thread-safe, its method `on_notify` can be called by multiple threads concurrently. In particular, consider the following situation: 1. TailInput calls `on_notify` on detach/shutdown (main thread) 2. In the same time, StatWatcher triggers `on_notify` on filesystem events (eventloop thread) This patch fixes this issue by introducing a mutex, which prevent multiple threads from entering into the critical session simultaneously.
- Loading branch information