Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Fix a synchronisation bug #32
The run method will almost always be called inside a thread. This commit fixes
The source of the problem is the fact that when someone stops the watcher,
A sitiuation where this could be a problem is when the run method is waiting on changes
Stoping the watcher and firing an event at the same time would unblock the run method
As you know, testing synchronization problems with unit tests is impossible... because these problems only occur when a special combination of events happen simultaneously. That's why there is no spec for this problem.