forked from oracle/truffleruby
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request oracle#436 in G/truffleruby from queue to master
* commit '5f3a55dc82d87d7535c65b70efb00444b8a974a6': (34 commits) Change log entry for locking fast path The timeout parameter in BlockingMatcher was dead code for a while Handle exceptions in BlockingMatcher Made BlockingMatcher more stable Fix queue closed semantics Missing boundaries Reorder Fix missing unlock Fix mutual exclusion specs Fix Thread::Queue specs and implement Fix closing semantics in queues Restructured closed tests UnsizedQueue.pop(true) never returns CLOSED Remove dead mutex Join threads created in specs Formatting Reorder code More specs for queues Spec Thread::Queue etc by just saying it’s the same class as ::Queue Improve some synchronisation specs ...
- Loading branch information
Showing
90 changed files
with
732 additions
and
488 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require_relative '../../spec_helper' | ||
require_relative '../../shared/queue/enque' | ||
|
||
describe "Queue#<<" do | ||
it_behaves_like :queue_enq, :<<, -> { Queue.new } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require_relative '../../spec_helper' | ||
require_relative '../../shared/queue/clear' | ||
|
||
describe "Queue#clear" do | ||
it_behaves_like :queue_clear, :clear, -> { Queue.new } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require_relative '../../spec_helper' | ||
require_relative '../../shared/queue/close' | ||
|
||
describe "Queue#close" do | ||
it_behaves_like :queue_close, :close, -> { Queue.new } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require_relative '../../spec_helper' | ||
require_relative '../../shared/queue/closed' | ||
|
||
describe "Queue#closed?" do | ||
it_behaves_like :queue_closed?, :closed?, -> { Queue.new } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require_relative '../../spec_helper' | ||
require_relative '../../shared/queue/deque' | ||
|
||
describe "Queue#deq" do | ||
it_behaves_like :queue_deq, :deq, -> { Queue.new } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require_relative '../../spec_helper' | ||
require_relative '../../shared/queue/empty' | ||
|
||
describe "Queue#empty?" do | ||
it_behaves_like :queue_empty?, :empty?, -> { Queue.new } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require_relative '../../spec_helper' | ||
require_relative '../../shared/queue/enque' | ||
|
||
describe "Queue#enq" do | ||
it_behaves_like :queue_enq, :enq, -> { Queue.new } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require_relative '../../spec_helper' | ||
require_relative '../../shared/queue/length' | ||
|
||
describe "Queue#length" do | ||
it_behaves_like :queue_length, :length, -> { Queue.new } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require_relative '../../spec_helper' | ||
require_relative '../../shared/queue/num_waiting' | ||
|
||
describe "Queue#num_waiting" do | ||
it_behaves_like :queue_num_waiting, :num_waiting, -> { Queue.new } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require_relative '../../spec_helper' | ||
require_relative '../../shared/queue/deque' | ||
|
||
describe "Queue#pop" do | ||
it_behaves_like :queue_deq, :pop, -> { Queue.new } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require_relative '../../spec_helper' | ||
require_relative '../../shared/queue/enque' | ||
|
||
describe "Queue#push" do | ||
it_behaves_like :queue_enq, :push, -> { Queue.new } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require_relative '../../spec_helper' | ||
require_relative '../../shared/queue/deque' | ||
|
||
describe "Queue#shift" do | ||
it_behaves_like :queue_deq, :shift, -> { Queue.new } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require_relative '../../spec_helper' | ||
require_relative '../../shared/queue/length' | ||
|
||
describe "Queue#size" do | ||
it_behaves_like :queue_length, :size, -> { Queue.new } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
require_relative '../../spec_helper' | ||
require_relative '../../shared/queue/enque' | ||
require_relative '../../shared/sizedqueue/enque' | ||
|
||
describe "SizedQueue#<<" do | ||
it_behaves_like :queue_enq, :<<, -> { SizedQueue.new(10) } | ||
end | ||
|
||
describe "SizedQueue#<<" do | ||
it_behaves_like :sizedqueue_enq, :<<, ->(n) { SizedQueue.new(n) } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require_relative '../../spec_helper' | ||
require_relative '../../shared/queue/clear' | ||
|
||
describe "SizedQueue#clear" do | ||
it_behaves_like :queue_clear, :clear, -> { SizedQueue.new(10) } | ||
end |
5 changes: 2 additions & 3 deletions
5
...y/library/thread/sizedqueue/close_spec.rb → spec/ruby/core/sizedqueue/close_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
.../library/thread/sizedqueue/closed_spec.rb → spec/ruby/core/sizedqueue/closed_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require_relative '../../spec_helper' | ||
require_relative '../../shared/queue/deque' | ||
|
||
describe "SizedQueue#deq" do | ||
it_behaves_like :queue_deq, :deq, -> { SizedQueue.new(10) } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require_relative '../../spec_helper' | ||
require_relative '../../shared/queue/empty' | ||
|
||
describe "SizedQueue#empty?" do | ||
it_behaves_like :queue_empty?, :empty?, -> { SizedQueue.new(10) } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
require_relative '../../spec_helper' | ||
require_relative '../../shared/queue/enque' | ||
require_relative '../../shared/sizedqueue/enque' | ||
|
||
describe "SizedQueue#enq" do | ||
it_behaves_like :queue_enq, :enq, -> { SizedQueue.new(10) } | ||
end | ||
|
||
describe "SizedQueue#enq" do | ||
it_behaves_like :sizedqueue_enq, :enq, ->(n) { SizedQueue.new(n) } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require_relative '../../spec_helper' | ||
require_relative '../../shared/queue/length' | ||
|
||
describe "SizedQueue#length" do | ||
it_behaves_like :queue_length, :length, -> { SizedQueue.new(10) } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
require_relative '../../spec_helper' | ||
require_relative '../../shared/sizedqueue/max' | ||
|
||
describe "SizedQueue#max" do | ||
it_behaves_like :sizedqueue_max, :max, ->(n) { SizedQueue.new(n) } | ||
end | ||
|
||
describe "SizedQueue#max=" do | ||
it_behaves_like :sizedqueue_max=, :max=, ->(n) { SizedQueue.new(n) } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require_relative '../../spec_helper' | ||
require_relative '../../shared/sizedqueue/new' | ||
|
||
describe "SizedQueue.new" do | ||
it_behaves_like :sizedqueue_new, :new, ->(*n) { SizedQueue.new(*n) } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require_relative '../../spec_helper' | ||
require_relative '../../shared/sizedqueue/num_waiting' | ||
|
||
describe "SizedQueue#num_waiting" do | ||
it_behaves_like :sizedqueue_num_waiting, :new, ->(n) { SizedQueue.new(n) } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require_relative '../../spec_helper' | ||
require_relative '../../shared/queue/deque' | ||
|
||
describe "SizedQueue#pop" do | ||
it_behaves_like :queue_deq, :pop, -> { SizedQueue.new(10) } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
require_relative '../../spec_helper' | ||
require_relative '../../shared/queue/enque' | ||
require_relative '../../shared/sizedqueue/enque' | ||
|
||
describe "SizedQueue#push" do | ||
it_behaves_like :queue_enq, :push, -> { SizedQueue.new(10) } | ||
end | ||
|
||
describe "SizedQueue#push" do | ||
it_behaves_like :sizedqueue_enq, :push, ->(n) { SizedQueue.new(n) } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require_relative '../../spec_helper' | ||
require_relative '../../shared/queue/deque' | ||
|
||
describe "SizedQueue#shift" do | ||
it_behaves_like :queue_deq, :shift, -> { SizedQueue.new(10) } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require_relative '../../spec_helper' | ||
require_relative '../../shared/queue/length' | ||
|
||
describe "SizedQueue#size" do | ||
it_behaves_like :queue_length, :size, -> { SizedQueue.new(10) } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.