From bd63d23a3c9458eaf58049d6125be82468e1304c Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Sat, 28 Dec 2024 15:44:20 -0500 Subject: [PATCH] chore: fix typos Signed-off-by: Rui Chen --- CHANGELOG.md | 4 ++-- docs-source/erlang_actor.in.md | 2 +- docs-source/erlang_actor.out.md | 2 +- examples/benchmark_atomic_1.rb | 2 +- examples/graph_atomic_bench.rb | 2 +- .../com/concurrent_ruby/ext/jsr166e/ConcurrentHashMapV8.java | 2 +- .../ext/jsr166e/nounsafe/ConcurrentHashMapV8.java | 2 +- .../concurrent/edge/lock_free_linked_set/node.rb | 2 +- .../concurrent/edge/old_channel_integration.rb | 2 +- lib/concurrent-ruby/concurrent/agent.rb | 4 ++-- lib/concurrent-ruby/concurrent/async.rb | 2 +- lib/concurrent-ruby/concurrent/atom.rb | 2 +- lib/concurrent-ruby/concurrent/delay.rb | 2 +- lib/concurrent-ruby/concurrent/executor/fixed_thread_pool.rb | 2 +- .../concurrent/executor/single_thread_executor.rb | 2 +- lib/concurrent-ruby/concurrent/map.rb | 2 +- lib/concurrent-ruby/concurrent/promise.rb | 2 +- lib/concurrent-ruby/concurrent/scheduled_task.rb | 2 +- lib/concurrent-ruby/concurrent/synchronization/object.rb | 2 +- lib/concurrent-ruby/concurrent/thread_safe/util/adder.rb | 2 +- .../concurrent/thread_safe/util/xor_shift_random.rb | 2 +- spec/concurrent/actor_spec.rb | 2 +- spec/concurrent/async_spec.rb | 4 ++-- spec/concurrent/executor/safe_task_executor_spec.rb | 2 +- spec/concurrent/executor/thread_pool_executor_shared.rb | 2 +- spec/concurrent/processing_actor_spec.rb | 2 +- spec/concurrent/utility/processor_count_spec.rb | 4 ++-- 27 files changed, 31 insertions(+), 31 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c0375c7d..e95cf22e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -296,7 +296,7 @@ concurrent-ruby-edge: * Simplification of `RubySingleThreadExecutor` * `Async` improvements - Each object uses its own `SingleThreadExecutor` instead of the global thread pool. - - No longers supports executor injection + - No longer supports executor injection - Much better documentation * `Atom` updates - No longer `Dereferenceable` @@ -471,7 +471,7 @@ Please see the [roadmap](https://github.com/ruby-concurrency/concurrent-ruby/iss * 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 +* Removed confusing warning when not using native extensions * Improved documentation ## Release v0.7.0 (13 August 2014) diff --git a/docs-source/erlang_actor.in.md b/docs-source/erlang_actor.in.md index d8f7a6da0..ed0b94e3c 100644 --- a/docs-source/erlang_actor.in.md +++ b/docs-source/erlang_actor.in.md @@ -254,7 +254,7 @@ The one exception from the original Erlang naming is exit. To avoid clashing with `Kernel#exit` it's called `terminate`. Until there is more information available here, the chapters listed below from -a book [lern you some Erlang](https://learnyousomeerlang.com) +a book [learn you some Erlang](https://learnyousomeerlang.com) are excellent source of information. The Ruby ErlangActor implementation has same behaviour. diff --git a/docs-source/erlang_actor.out.md b/docs-source/erlang_actor.out.md index f062557a4..f94d1492c 100644 --- a/docs-source/erlang_actor.out.md +++ b/docs-source/erlang_actor.out.md @@ -276,7 +276,7 @@ The one exception from the original Erlang naming is exit. To avoid clashing with `Kernel#exit` it's called `terminate`. Until there is more information available here, the chapters listed below from -a book [lern you some Erlang](https://learnyousomeerlang.com) +a book [learn you some Erlang](https://learnyousomeerlang.com) are excellent source of information. The Ruby ErlangActor implementation has same behaviour. diff --git a/examples/benchmark_atomic_1.rb b/examples/benchmark_atomic_1.rb index f3f09b08e..d9deedf1b 100755 --- a/examples/benchmark_atomic_1.rb +++ b/examples/benchmark_atomic_1.rb @@ -133,7 +133,7 @@ def para_prepare(&block) # NOTE: It seems to me that this measurement method # is sensible to how the system dispatches his resources. # -# More precise caluclation could be done using +# More precise calculation could be done using # getrusage's times ret = Benchmark.measure do $go = true diff --git a/examples/graph_atomic_bench.rb b/examples/graph_atomic_bench.rb index c50da1737..b124f3b35 100755 --- a/examples/graph_atomic_bench.rb +++ b/examples/graph_atomic_bench.rb @@ -47,7 +47,7 @@ end elsif conf[:vary] == "speed" # Varies the execution time of the update block - # by using long calulation (MD5) + # by using long calculation (MD5) # # NOTE: Thread.pass and sleep() are not usable by the atomic # lock. It needs to run the whole block without hitting diff --git a/ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/ConcurrentHashMapV8.java b/ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/ConcurrentHashMapV8.java index 86aa4eb06..dc9901fb7 100644 --- a/ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/ConcurrentHashMapV8.java +++ b/ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/ConcurrentHashMapV8.java @@ -481,7 +481,7 @@ public static interface Spliterator extends Iterator { * * Maintaining API and serialization compatibility with previous * versions of this class introduces several oddities. Mainly: We - * leave untouched but unused constructor arguments refering to + * leave untouched but unused constructor arguments referring to * concurrencyLevel. We accept a loadFactor constructor argument, * but apply it only to initial table capacity (which is the only * time that we can guarantee to honor it.) We also declare an diff --git a/ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/nounsafe/ConcurrentHashMapV8.java b/ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/nounsafe/ConcurrentHashMapV8.java index b7fc5a937..a4e73ea14 100644 --- a/ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/nounsafe/ConcurrentHashMapV8.java +++ b/ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/nounsafe/ConcurrentHashMapV8.java @@ -484,7 +484,7 @@ public static interface Spliterator extends Iterator { * * Maintaining API and serialization compatibility with previous * versions of this class introduces several oddities. Mainly: We - * leave untouched but unused constructor arguments refering to + * leave untouched but unused constructor arguments referring to * concurrencyLevel. We accept a loadFactor constructor argument, * but apply it only to initial table capacity (which is the only * time that we can guarantee to honor it.) We also declare an diff --git a/lib/concurrent-ruby-edge/concurrent/edge/lock_free_linked_set/node.rb b/lib/concurrent-ruby-edge/concurrent/edge/lock_free_linked_set/node.rb index d7fafa370..f3682bbfc 100644 --- a/lib/concurrent-ruby-edge/concurrent/edge/lock_free_linked_set/node.rb +++ b/lib/concurrent-ruby-edge/concurrent/edge/lock_free_linked_set/node.rb @@ -38,7 +38,7 @@ def next_node @SuccessorReference.value end - # This method provides a unqiue key for the data which will be used for + # This method provides a unique key for the data which will be used for # ordering. This is configurable, and changes depending on how you wish # the nodes to be ordered. def key_for(data) diff --git a/lib/concurrent-ruby-edge/concurrent/edge/old_channel_integration.rb b/lib/concurrent-ruby-edge/concurrent/edge/old_channel_integration.rb index efb003eff..a215ad80c 100644 --- a/lib/concurrent-ruby-edge/concurrent/edge/old_channel_integration.rb +++ b/lib/concurrent-ruby-edge/concurrent/edge/old_channel_integration.rb @@ -36,7 +36,7 @@ module OldChannelIntegration # @!visibility private - # Zips with selected value form the suplied channels + # Zips with selected value form the supplied channels # @return [Future] def then_select(*channels) future = Concurrent::Promises.select(*channels) diff --git a/lib/concurrent-ruby/concurrent/agent.rb b/lib/concurrent-ruby/concurrent/agent.rb index 2d32926ba..dc8a26000 100644 --- a/lib/concurrent-ruby/concurrent/agent.rb +++ b/lib/concurrent-ruby/concurrent/agent.rb @@ -371,7 +371,7 @@ def await_for(timeout) # @param [Float] timeout the maximum number of seconds to wait # @return [Boolean] true if all actions complete before timeout # - # @raise [Concurrent::TimeoutError] when timout is reached + # @raise [Concurrent::TimeoutError] when timeout is reached # # @!macro agent_await_warning def await_for!(timeout) @@ -477,7 +477,7 @@ def await_for(timeout, *agents) # @param [Array] agents the Agents on which to wait # @return [Boolean] true if all actions complete before timeout # - # @raise [Concurrent::TimeoutError] when timout is reached + # @raise [Concurrent::TimeoutError] when timeout is reached # @!macro agent_await_warning def await_for!(timeout, *agents) raise Concurrent::TimeoutError unless await_for(timeout, *agents) diff --git a/lib/concurrent-ruby/concurrent/async.rb b/lib/concurrent-ruby/concurrent/async.rb index f9f8adf00..97c5a6b2d 100644 --- a/lib/concurrent-ruby/concurrent/async.rb +++ b/lib/concurrent-ruby/concurrent/async.rb @@ -218,7 +218,7 @@ module Async # @!method self.new(*args, &block) # - # Instanciate a new object and ensure proper initialization of the + # Instantiate a new object and ensure proper initialization of the # synchronization mechanisms. # # @param [Array] args Zero or more arguments to be passed to the diff --git a/lib/concurrent-ruby/concurrent/atom.rb b/lib/concurrent-ruby/concurrent/atom.rb index 1074006d7..f590a23d9 100644 --- a/lib/concurrent-ruby/concurrent/atom.rb +++ b/lib/concurrent-ruby/concurrent/atom.rb @@ -113,7 +113,7 @@ class Atom < Synchronization::Object # @option opts [Proc] :validator (nil) Optional proc used to validate new # values. It must accept one and only one argument which will be the # intended new value. The validator will return true if the new value - # is acceptable else return false (preferrably) or raise an exception. + # is acceptable else return false (preferably) or raise an exception. # # @!macro deref_options # diff --git a/lib/concurrent-ruby/concurrent/delay.rb b/lib/concurrent-ruby/concurrent/delay.rb index 923773cbc..0d6d91a57 100644 --- a/lib/concurrent-ruby/concurrent/delay.rb +++ b/lib/concurrent-ruby/concurrent/delay.rb @@ -19,7 +19,7 @@ module Concurrent # # When a `Delay` is created its state is set to `pending`. The value and # reason are both `nil`. The first time the `#value` method is called the - # enclosed opration will be run and the calling thread will block. Other + # enclosed operation will be run and the calling thread will block. Other # threads attempting to call `#value` will block as well. Once the operation # is complete the *value* will be set to the result of the operation or the # *reason* will be set to the raised exception, as appropriate. All threads diff --git a/lib/concurrent-ruby/concurrent/executor/fixed_thread_pool.rb b/lib/concurrent-ruby/concurrent/executor/fixed_thread_pool.rb index 993c3f1e3..8324c0673 100644 --- a/lib/concurrent-ruby/concurrent/executor/fixed_thread_pool.rb +++ b/lib/concurrent-ruby/concurrent/executor/fixed_thread_pool.rb @@ -83,7 +83,7 @@ module Concurrent # # This is a no-op on some pool implementation (e.g. the Java one). The Ruby # pool will auto-prune each time a new job is posted. You will need to call - # this method explicitely in case your application post jobs in bursts (a + # this method explicitly in case your application post jobs in bursts (a # lot of jobs and then nothing for long periods) # @!macro thread_pool_executor_public_api diff --git a/lib/concurrent-ruby/concurrent/executor/single_thread_executor.rb b/lib/concurrent-ruby/concurrent/executor/single_thread_executor.rb index f1474ea9f..220eb0ff6 100644 --- a/lib/concurrent-ruby/concurrent/executor/single_thread_executor.rb +++ b/lib/concurrent-ruby/concurrent/executor/single_thread_executor.rb @@ -27,7 +27,7 @@ module Concurrent # is received. This pattern has several issues. The thread itself is highly # susceptible to errors during processing. Also, the thread itself must be # constantly monitored and restarted should it die. `SingleThreadExecutor` - # encapsulates all these bahaviors. The task processor is highly resilient + # encapsulates all these behaviors. The task processor is highly resilient # to errors from within tasks. Also, should the thread die it will # automatically be restarted. # diff --git a/lib/concurrent-ruby/concurrent/map.rb b/lib/concurrent-ruby/concurrent/map.rb index 601e36504..b263f83d8 100644 --- a/lib/concurrent-ruby/concurrent/map.rb +++ b/lib/concurrent-ruby/concurrent/map.rb @@ -148,7 +148,7 @@ def [](key) if value = super # non-falsy value is an existing mapping, return it right away value # re-check is done with get_or_default(key, NULL) instead of a simple !key?(key) in order to avoid a race condition, whereby by the time the current thread gets to the key?(key) call - # a key => value mapping might have already been created by a different thread (key?(key) would then return true, this elsif branch wouldn't be taken and an incorrent +nil+ value + # a key => value mapping might have already been created by a different thread (key?(key) would then return true, this elsif branch wouldn't be taken and an incorrect +nil+ value # would be returned) # note: nil == value check is not technically necessary elsif @default_proc && nil == value && NULL == (value = get_or_default(key, NULL)) diff --git a/lib/concurrent-ruby/concurrent/promise.rb b/lib/concurrent-ruby/concurrent/promise.rb index ccc47dd62..c717f9b0d 100644 --- a/lib/concurrent-ruby/concurrent/promise.rb +++ b/lib/concurrent-ruby/concurrent/promise.rb @@ -103,7 +103,7 @@ module Concurrent # - if parent is *rejected* the child will be *pending* (but will ultimately be *rejected*) # # Promises are executed asynchronously from the main thread. By the time a - # child Promise finishes intialization it may be in a different state than its + # child Promise finishes initialization it may be in a different state than its # parent (by the time a child is created its parent may have completed # execution and changed state). Despite being asynchronous, however, the order # of execution of Promise objects in a chain (or tree) is strictly defined. diff --git a/lib/concurrent-ruby/concurrent/scheduled_task.rb b/lib/concurrent-ruby/concurrent/scheduled_task.rb index 429fc0683..efe9e193a 100644 --- a/lib/concurrent-ruby/concurrent/scheduled_task.rb +++ b/lib/concurrent-ruby/concurrent/scheduled_task.rb @@ -193,7 +193,7 @@ def initialize(delay, opts = {}, &task) end end - # The `delay` value given at instanciation. + # The `delay` value given at instantiation. # # @return [Float] the initial delay. def initial_delay diff --git a/lib/concurrent-ruby/concurrent/synchronization/object.rb b/lib/concurrent-ruby/concurrent/synchronization/object.rb index e839c9f18..592190708 100644 --- a/lib/concurrent-ruby/concurrent/synchronization/object.rb +++ b/lib/concurrent-ruby/concurrent/synchronization/object.rb @@ -58,7 +58,7 @@ def self.new(*args, &block) # Creates methods for reading and writing to a instance variable with # volatile (Java) semantic as {.attr_volatile} does. - # The instance variable should be accessed oly through generated methods. + # The instance variable should be accessed only through generated methods. # This method generates following methods: `value`, `value=(new_value) #=> new_value`, # `swap_value(new_value) #=> old_value`, # `compare_and_set_value(expected, value) #=> true || false`, `update_value(&block)`. diff --git a/lib/concurrent-ruby/concurrent/thread_safe/util/adder.rb b/lib/concurrent-ruby/concurrent/thread_safe/util/adder.rb index 7a6e8d5c0..852b403b8 100644 --- a/lib/concurrent-ruby/concurrent/thread_safe/util/adder.rb +++ b/lib/concurrent-ruby/concurrent/thread_safe/util/adder.rb @@ -9,7 +9,7 @@ module ThreadSafe # @!visibility private module Util - # A Ruby port of the Doug Lea's jsr166e.LondAdder class version 1.8 + # A Ruby port of the Doug Lea's jsr166e.LongAdder class version 1.8 # available in public domain. # # Original source code available here: diff --git a/lib/concurrent-ruby/concurrent/thread_safe/util/xor_shift_random.rb b/lib/concurrent-ruby/concurrent/thread_safe/util/xor_shift_random.rb index bdde2dd8b..c231d182c 100644 --- a/lib/concurrent-ruby/concurrent/thread_safe/util/xor_shift_random.rb +++ b/lib/concurrent-ruby/concurrent/thread_safe/util/xor_shift_random.rb @@ -15,7 +15,7 @@ module Util # Usage: # x = XorShiftRandom.get # uses Kernel.rand to generate an initial seed # while true - # if (x = XorShiftRandom.xorshift).odd? # thread-localy generate a next random number + # if (x = XorShiftRandom.xorshift).odd? # thread-locally generate a next random number # do_something_at_random # end # end diff --git a/spec/concurrent/actor_spec.rb b/spec/concurrent/actor_spec.rb index 5bb639fed..9f1e53b7c 100644 --- a/spec/concurrent/actor_spec.rb +++ b/spec/concurrent/actor_spec.rb @@ -160,7 +160,7 @@ def on_message(message) end describe 'dead letter routing' do - it 'logs by deafault' do + it 'logs by default' do ping = Ping.spawn! :ping, [] ping << :terminate! ping << 'asd' diff --git a/spec/concurrent/async_spec.rb b/spec/concurrent/async_spec.rb index c0ebfe8e6..aae2642db 100644 --- a/spec/concurrent/async_spec.rb +++ b/spec/concurrent/async_spec.rb @@ -153,7 +153,7 @@ def many(*args, &block) nil; end }.to raise_error(ArgumentError) end - it 'raises an error when pasing too many arguments (arity >= 0)' do + it 'raises an error when passing too many arguments (arity >= 0)' do expect { subject.async.echo(1, 2, 3, 4, 5) }.to raise_error(StandardError) @@ -224,7 +224,7 @@ def many(*args, &block) nil; end }.to raise_error(ArgumentError) end - it 'raises an error when pasing too many arguments (arity >= 0)' do + it 'raises an error when passing too many arguments (arity >= 0)' do expect { subject.await.echo(1, 2, 3, 4, 5) }.to raise_error(StandardError) diff --git a/spec/concurrent/executor/safe_task_executor_spec.rb b/spec/concurrent/executor/safe_task_executor_spec.rb index 5b4edf6a4..2907109e9 100644 --- a/spec/concurrent/executor/safe_task_executor_spec.rb +++ b/spec/concurrent/executor/safe_task_executor_spec.rb @@ -33,7 +33,7 @@ module Concurrent expect(expected).to eq [1, 2, 3] end - it 'protectes #execute with a mutex' do + it 'protects #execute with a mutex' do expect(subject).to receive(:synchronize).with(no_args) subject.execute end diff --git a/spec/concurrent/executor/thread_pool_executor_shared.rb b/spec/concurrent/executor/thread_pool_executor_shared.rb index 1fbf8de6d..147e2c5ca 100644 --- a/spec/concurrent/executor/thread_pool_executor_shared.rb +++ b/spec/concurrent/executor/thread_pool_executor_shared.rb @@ -411,7 +411,7 @@ subject << proc { all_tasks_posted.wait; initial_executed.increment; } end - # Inject 20 more tasks, which should throw an exeption + # Inject 20 more tasks, which should throw an exception 20.times do expect { subject << proc { subsequent_executed.increment; } diff --git a/spec/concurrent/processing_actor_spec.rb b/spec/concurrent/processing_actor_spec.rb index 36e3ac0e8..4632eaed8 100644 --- a/spec/concurrent/processing_actor_spec.rb +++ b/spec/concurrent/processing_actor_spec.rb @@ -29,7 +29,7 @@ def count(actor, count) # continue running count(actor, count) when Integer - # this will call count again to set up what to do on next message, based on new state `count + numer` + # this will call count again to set up what to do on next message, based on new state `count + number` count(actor, count + number_or_command) end end diff --git a/spec/concurrent/utility/processor_count_spec.rb b/spec/concurrent/utility/processor_count_spec.rb index 8de31e027..34d133f70 100644 --- a/spec/concurrent/utility/processor_count_spec.rb +++ b/spec/concurrent/utility/processor_count_spec.rb @@ -4,7 +4,7 @@ module Concurrent RSpec.describe '#processor_count' do - it 'retuns a positive integer' do + it 'returns a positive integer' do expect(Concurrent::processor_count).to be_a Integer expect(Concurrent::processor_count).to be >= 1 end @@ -12,7 +12,7 @@ module Concurrent RSpec.describe '#physical_processor_count' do - it 'retuns a positive integer' do + it 'returns a positive integer' do expect(Concurrent::physical_processor_count).to be_a Integer expect(Concurrent::physical_processor_count).to be >= 1 end