Skip to content

Commit 5d700c5

Browse files
authored
chore: fix typos (#1076)
Signed-off-by: Rui Chen <[email protected]>
1 parent 957cf7d commit 5d700c5

27 files changed

+31
-31
lines changed

CHANGELOG.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ concurrent-ruby-edge:
296296
* Simplification of `RubySingleThreadExecutor`
297297
* `Async` improvements
298298
- Each object uses its own `SingleThreadExecutor` instead of the global thread pool.
299-
- No longers supports executor injection
299+
- No longer supports executor injection
300300
- Much better documentation
301301
* `Atom` updates
302302
- No longer `Dereferenceable`
@@ -471,7 +471,7 @@ Please see the [roadmap](https://github.com/ruby-concurrency/concurrent-ruby/iss
471471
* Fixed bug with return value of `Concurrent::Actor::Utils::Pool#ask`
472472
* Fixed timing bug in `TimerTask`
473473
* Fixed bug when creating a `JavaThreadPoolExecutor` with minimum pool size of zero
474-
* Removed confusing warning when not using native extenstions
474+
* Removed confusing warning when not using native extensions
475475
* Improved documentation
476476

477477
## Release v0.7.0 (13 August 2014)

docs-source/erlang_actor.in.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ The one exception from the original Erlang naming is exit.
254254
To avoid clashing with `Kernel#exit` it's called `terminate`.
255255

256256
Until there is more information available here, the chapters listed below from
257-
a book [lern you some Erlang](https://learnyousomeerlang.com)
257+
a book [learn you some Erlang](https://learnyousomeerlang.com)
258258
are excellent source of information.
259259
The Ruby ErlangActor implementation has same behaviour.
260260

docs-source/erlang_actor.out.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ The one exception from the original Erlang naming is exit.
276276
To avoid clashing with `Kernel#exit` it's called `terminate`.
277277

278278
Until there is more information available here, the chapters listed below from
279-
a book [lern you some Erlang](https://learnyousomeerlang.com)
279+
a book [learn you some Erlang](https://learnyousomeerlang.com)
280280
are excellent source of information.
281281
The Ruby ErlangActor implementation has same behaviour.
282282

examples/benchmark_atomic_1.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def para_prepare(&block)
133133
# NOTE: It seems to me that this measurement method
134134
# is sensible to how the system dispatches his resources.
135135
#
136-
# More precise caluclation could be done using
136+
# More precise calculation could be done using
137137
# getrusage's times
138138
ret = Benchmark.measure do
139139
$go = true

examples/graph_atomic_bench.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
end
4848
elsif conf[:vary] == "speed"
4949
# Varies the execution time of the update block
50-
# by using long calulation (MD5)
50+
# by using long calculation (MD5)
5151
#
5252
# NOTE: Thread.pass and sleep() are not usable by the atomic
5353
# lock. It needs to run the whole block without hitting

ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/ConcurrentHashMapV8.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ public static interface Spliterator<T> extends Iterator<T> {
481481
*
482482
* Maintaining API and serialization compatibility with previous
483483
* versions of this class introduces several oddities. Mainly: We
484-
* leave untouched but unused constructor arguments refering to
484+
* leave untouched but unused constructor arguments referring to
485485
* concurrencyLevel. We accept a loadFactor constructor argument,
486486
* but apply it only to initial table capacity (which is the only
487487
* time that we can guarantee to honor it.) We also declare an

ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/nounsafe/ConcurrentHashMapV8.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ public static interface Spliterator<T> extends Iterator<T> {
484484
*
485485
* Maintaining API and serialization compatibility with previous
486486
* versions of this class introduces several oddities. Mainly: We
487-
* leave untouched but unused constructor arguments refering to
487+
* leave untouched but unused constructor arguments referring to
488488
* concurrencyLevel. We accept a loadFactor constructor argument,
489489
* but apply it only to initial table capacity (which is the only
490490
* time that we can guarantee to honor it.) We also declare an

lib/concurrent-ruby-edge/concurrent/edge/lock_free_linked_set/node.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def next_node
3838
@SuccessorReference.value
3939
end
4040

41-
# This method provides a unqiue key for the data which will be used for
41+
# This method provides a unique key for the data which will be used for
4242
# ordering. This is configurable, and changes depending on how you wish
4343
# the nodes to be ordered.
4444
def key_for(data)

lib/concurrent-ruby-edge/concurrent/edge/old_channel_integration.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ module OldChannelIntegration
3636

3737
# @!visibility private
3838

39-
# Zips with selected value form the suplied channels
39+
# Zips with selected value form the supplied channels
4040
# @return [Future]
4141
def then_select(*channels)
4242
future = Concurrent::Promises.select(*channels)

lib/concurrent-ruby/concurrent/agent.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ def await_for(timeout)
371371
# @param [Float] timeout the maximum number of seconds to wait
372372
# @return [Boolean] true if all actions complete before timeout
373373
#
374-
# @raise [Concurrent::TimeoutError] when timout is reached
374+
# @raise [Concurrent::TimeoutError] when timeout is reached
375375
#
376376
# @!macro agent_await_warning
377377
def await_for!(timeout)
@@ -477,7 +477,7 @@ def await_for(timeout, *agents)
477477
# @param [Array<Concurrent::Agent>] agents the Agents on which to wait
478478
# @return [Boolean] true if all actions complete before timeout
479479
#
480-
# @raise [Concurrent::TimeoutError] when timout is reached
480+
# @raise [Concurrent::TimeoutError] when timeout is reached
481481
# @!macro agent_await_warning
482482
def await_for!(timeout, *agents)
483483
raise Concurrent::TimeoutError unless await_for(timeout, *agents)

lib/concurrent-ruby/concurrent/async.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ module Async
218218

219219
# @!method self.new(*args, &block)
220220
#
221-
# Instanciate a new object and ensure proper initialization of the
221+
# Instantiate a new object and ensure proper initialization of the
222222
# synchronization mechanisms.
223223
#
224224
# @param [Array<Object>] args Zero or more arguments to be passed to the

lib/concurrent-ruby/concurrent/atom.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class Atom < Synchronization::Object
113113
# @option opts [Proc] :validator (nil) Optional proc used to validate new
114114
# values. It must accept one and only one argument which will be the
115115
# intended new value. The validator will return true if the new value
116-
# is acceptable else return false (preferrably) or raise an exception.
116+
# is acceptable else return false (preferably) or raise an exception.
117117
#
118118
# @!macro deref_options
119119
#

lib/concurrent-ruby/concurrent/delay.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module Concurrent
1919
#
2020
# When a `Delay` is created its state is set to `pending`. The value and
2121
# reason are both `nil`. The first time the `#value` method is called the
22-
# enclosed opration will be run and the calling thread will block. Other
22+
# enclosed operation will be run and the calling thread will block. Other
2323
# threads attempting to call `#value` will block as well. Once the operation
2424
# is complete the *value* will be set to the result of the operation or the
2525
# *reason* will be set to the raised exception, as appropriate. All threads

lib/concurrent-ruby/concurrent/executor/fixed_thread_pool.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ module Concurrent
8383
#
8484
# This is a no-op on some pool implementation (e.g. the Java one). The Ruby
8585
# pool will auto-prune each time a new job is posted. You will need to call
86-
# this method explicitely in case your application post jobs in bursts (a
86+
# this method explicitly in case your application post jobs in bursts (a
8787
# lot of jobs and then nothing for long periods)
8888

8989
# @!macro thread_pool_executor_public_api

lib/concurrent-ruby/concurrent/executor/single_thread_executor.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module Concurrent
2727
# is received. This pattern has several issues. The thread itself is highly
2828
# susceptible to errors during processing. Also, the thread itself must be
2929
# constantly monitored and restarted should it die. `SingleThreadExecutor`
30-
# encapsulates all these bahaviors. The task processor is highly resilient
30+
# encapsulates all these behaviors. The task processor is highly resilient
3131
# to errors from within tasks. Also, should the thread die it will
3232
# automatically be restarted.
3333
#

lib/concurrent-ruby/concurrent/map.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def [](key)
148148
if value = super # non-falsy value is an existing mapping, return it right away
149149
value
150150
# 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
151-
# 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
151+
# 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
152152
# would be returned)
153153
# note: nil == value check is not technically necessary
154154
elsif @default_proc && nil == value && NULL == (value = get_or_default(key, NULL))

lib/concurrent-ruby/concurrent/promise.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ module Concurrent
103103
# - if parent is *rejected* the child will be *pending* (but will ultimately be *rejected*)
104104
#
105105
# Promises are executed asynchronously from the main thread. By the time a
106-
# child Promise finishes intialization it may be in a different state than its
106+
# child Promise finishes initialization it may be in a different state than its
107107
# parent (by the time a child is created its parent may have completed
108108
# execution and changed state). Despite being asynchronous, however, the order
109109
# of execution of Promise objects in a chain (or tree) is strictly defined.

lib/concurrent-ruby/concurrent/scheduled_task.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def initialize(delay, opts = {}, &task)
193193
end
194194
end
195195

196-
# The `delay` value given at instanciation.
196+
# The `delay` value given at instantiation.
197197
#
198198
# @return [Float] the initial delay.
199199
def initial_delay

lib/concurrent-ruby/concurrent/synchronization/object.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def self.new(*args, &block)
5858

5959
# Creates methods for reading and writing to a instance variable with
6060
# volatile (Java) semantic as {.attr_volatile} does.
61-
# The instance variable should be accessed oly through generated methods.
61+
# The instance variable should be accessed only through generated methods.
6262
# This method generates following methods: `value`, `value=(new_value) #=> new_value`,
6363
# `swap_value(new_value) #=> old_value`,
6464
# `compare_and_set_value(expected, value) #=> true || false`, `update_value(&block)`.

lib/concurrent-ruby/concurrent/thread_safe/util/adder.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module ThreadSafe
99
# @!visibility private
1010
module Util
1111

12-
# A Ruby port of the Doug Lea's jsr166e.LondAdder class version 1.8
12+
# A Ruby port of the Doug Lea's jsr166e.LongAdder class version 1.8
1313
# available in public domain.
1414
#
1515
# Original source code available here:

lib/concurrent-ruby/concurrent/thread_safe/util/xor_shift_random.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module Util
1515
# Usage:
1616
# x = XorShiftRandom.get # uses Kernel.rand to generate an initial seed
1717
# while true
18-
# if (x = XorShiftRandom.xorshift).odd? # thread-localy generate a next random number
18+
# if (x = XorShiftRandom.xorshift).odd? # thread-locally generate a next random number
1919
# do_something_at_random
2020
# end
2121
# end

spec/concurrent/actor_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def on_message(message)
160160
end
161161

162162
describe 'dead letter routing' do
163-
it 'logs by deafault' do
163+
it 'logs by default' do
164164
ping = Ping.spawn! :ping, []
165165
ping << :terminate!
166166
ping << 'asd'

spec/concurrent/async_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def many(*args, &block) nil; end
153153
}.to raise_error(ArgumentError)
154154
end
155155

156-
it 'raises an error when pasing too many arguments (arity >= 0)' do
156+
it 'raises an error when passing too many arguments (arity >= 0)' do
157157
expect {
158158
subject.async.echo(1, 2, 3, 4, 5)
159159
}.to raise_error(StandardError)
@@ -224,7 +224,7 @@ def many(*args, &block) nil; end
224224
}.to raise_error(ArgumentError)
225225
end
226226

227-
it 'raises an error when pasing too many arguments (arity >= 0)' do
227+
it 'raises an error when passing too many arguments (arity >= 0)' do
228228
expect {
229229
subject.await.echo(1, 2, 3, 4, 5)
230230
}.to raise_error(StandardError)

spec/concurrent/executor/safe_task_executor_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ module Concurrent
3333
expect(expected).to eq [1, 2, 3]
3434
end
3535

36-
it 'protectes #execute with a mutex' do
36+
it 'protects #execute with a mutex' do
3737
expect(subject).to receive(:synchronize).with(no_args)
3838
subject.execute
3939
end

spec/concurrent/executor/thread_pool_executor_shared.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@
411411
subject << proc { all_tasks_posted.wait; initial_executed.increment; }
412412
end
413413

414-
# Inject 20 more tasks, which should throw an exeption
414+
# Inject 20 more tasks, which should throw an exception
415415
20.times do
416416
expect {
417417
subject << proc { subsequent_executed.increment; }

spec/concurrent/processing_actor_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def count(actor, count)
2929
# continue running
3030
count(actor, count)
3131
when Integer
32-
# this will call count again to set up what to do on next message, based on new state `count + numer`
32+
# this will call count again to set up what to do on next message, based on new state `count + number`
3333
count(actor, count + number_or_command)
3434
end
3535
end

spec/concurrent/utility/processor_count_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ module Concurrent
44

55
RSpec.describe '#processor_count' do
66

7-
it 'retuns a positive integer' do
7+
it 'returns a positive integer' do
88
expect(Concurrent::processor_count).to be_a Integer
99
expect(Concurrent::processor_count).to be >= 1
1010
end
1111
end
1212

1313
RSpec.describe '#physical_processor_count' do
1414

15-
it 'retuns a positive integer' do
15+
it 'returns a positive integer' do
1616
expect(Concurrent::physical_processor_count).to be_a Integer
1717
expect(Concurrent::physical_processor_count).to be >= 1
1818
end

0 commit comments

Comments
 (0)