Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Please see the [roadmap](https://github.com/ruby-concurrency/concurrent-ruby/iss
* Added missing synchronizations to `TimerSet`
* Fixed bug with return value of `Concurrent::Actor::Utils::Pool#ask`
* Fixed timing bug in `TimerTask`
* Fixed bug when creating a `JavaThreadPoolExecutor` with minimum pool size of zero
* Removed confusing warning when not using native extenstions
* Improved documentation

Expand Down
6 changes: 2 additions & 4 deletions lib/concurrent/executor/java_thread_pool_executor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ def initialize(opts = {})
raise ArgumentError.new('min_threads cannot be more than max_threads') if min_length > max_length
raise ArgumentError.new("#{@overflow_policy} is not a valid overflow policy") unless OVERFLOW_POLICIES.keys.include?(@overflow_policy)

if min_length == 0 && @max_queue == 0
queue = java.util.concurrent.SynchronousQueue.new
elsif @max_queue == 0
if @max_queue == 0
queue = java.util.concurrent.LinkedBlockingQueue.new
else
queue = java.util.concurrent.LinkedBlockingQueue.new(@max_queue)
Expand All @@ -90,7 +88,7 @@ def initialize(opts = {})
set_shutdown_hook
end

# @!macro executor_module_method_can_overflow_question
# @!macro executor_module_method_can_overflow_question
def can_overflow?
@max_queue != 0
end
Expand Down