Skip to content

Commit

Permalink
Increase the period works? wait before unblocking the main thread.
Browse files Browse the repository at this point in the history
There are two threads running when we are testing if an adapter works or not:
the main thread and the "guarding" thread. The guarding thread only ensures
that errors won't result in an indefinite blockage. Increasing the waiting time
would give the main thread more time which could be usefull on slow machines.
  • Loading branch information
Maher4Ever committed Apr 3, 2012
1 parent 64ae1de commit 4289b74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/listen/adapter.rb
Expand Up @@ -122,7 +122,7 @@ def self.works?(directory, options = {})

FileUtils.touch(test_file)

t = Thread.new { sleep(adapter.latency * 2); adapter.stop }
t = Thread.new { sleep(adapter.latency * 5); adapter.stop }

adapter.wait_for_callback
work
Expand Down

0 comments on commit 4289b74

Please sign in to comment.