Skip to content
Browse files

deleting superfluous code

  • Loading branch information...
1 parent a115935 commit 83bf1d24c1e9f18f696692ef5ccb16199018425f @mperham committed
Showing with 2 additions and 5 deletions.
  1. +1 −1 Rakefile
  2. +1 −4 test/timed_queue.rb
View
2 Rakefile
@@ -5,4 +5,4 @@ Rake::TestTask.new(:test) do |test|
test.pattern = 'test/**/test_*.rb'
end
-task :default => :test
+task :default => :test
View
5 test/timed_queue.rb
@@ -4,7 +4,6 @@
class TimedQueue
def initialize
@que = []
- @waiting = []
@mutex = Mutex.new
@resource = ConditionVariable.new
end
@@ -20,9 +19,7 @@ def push(obj)
def timed_pop(timeout=0.5)
while true
@mutex.synchronize do
- @waiting.delete(Thread.current)
if @que.empty?
- @waiting.push Thread.current
@resource.wait(@mutex, timeout)
raise TimeoutError if @que.empty?
else
@@ -45,4 +42,4 @@ def clear
def length
@que.length
end
-end
+end

0 comments on commit 83bf1d2

Please sign in to comment.
Something went wrong with that request. Please try again.