Permalink
Browse files

Fix a synchronisation bug that caused adapters to report wrong events

  • Loading branch information...
1 parent a9f1fd5 commit edff3eb1dfca5e7864460ece2322e85097fb0209 @Maher4Ever Maher4Ever committed Sep 11, 2012
Showing with 1 addition and 1 deletion.
  1. +1 โˆ’1 lib/listen/adapter.rb
@@ -194,6 +194,7 @@ def report_changes
end
@callback.call(changed_dirs, {})
+ @turnstile.signal
end
private
@@ -205,7 +206,6 @@ def poll_changed_dirs
until @stop
sleep(@latency)
report_changes
- @turnstile.signal
end
end
end

5 comments on commit edff3eb

@netzpirat

Just a single line, but tricky as hell. ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘

@Maher4Ever
Member

Tricky indeed. While debugging this issue, I almost rewrote the Adapter class :P. Anyhow, I'm glad it worked for you :)

@netzpirat

I must admit that I also tried to fix this, but I gave myself a time slot of 30 minutes and failed miserably.

@Maher4Ever
Member

No worries, it also took me a fair amount of time to figure this one out. Hopefully I'll find some time soon to refactor parts of the code to simplify fixing errors in the future.

@thibaudgg
Member

Pure awesomeness, well done!

Please sign in to comment.