Skip to content

Commit 7871db0

Browse files
committed
typos
1 parent 9d32a47 commit 7871db0

13 files changed

+31
-31
lines changed

examples/catalysts.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function test_zip2()
6161
sendall, receiveall = Reagents.channel(Tuple{Int,Char}, Nothing)
6262

6363
#=
64-
If the items are aviable in `receive1` and `receive2`, the `catalyst`
64+
If the items are available in `receive1` and `receive2`, the `catalyst`
6565
reagent automatically tries to pass them to `sendall`:
6666
=#
6767
catalyst = (receive1 & receive2) sendall

examples/dualcontainers.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function dualcontainer(::Type{T}, Items, Reservations = Items) where {T}
2222
)
2323
end
2424

25-
# APIs required for the containres:
25+
# APIs required for the containers:
2626
function putting end
2727
function taking end
2828

examples/locks.jl

+10-10
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ end
2121
# acquire the lock will block until the element is put back into the container:
2222

2323
acquiring(l::SimpleLock) = taking(l.access)
24-
realeasing(l::SimpleLock) = Return(nothing) putting(l.access)
24+
releasing(l::SimpleLock) = Return(nothing) putting(l.access)
2525

2626
Base.lock(l::SimpleLock) = acquiring(l)()
27-
Base.unlock(l::SimpleLock) = realeasing(l)()
27+
Base.unlock(l::SimpleLock) = releasing(l)()
2828

2929
# Thus, when creating a lock with an empty container, it is in the locked state.
3030
# We need to unlock it (i.e., put one element in the container) before start
@@ -204,10 +204,10 @@ function SimpleSemaphore(n::Integer)
204204
end
205205

206206
acquiring(l::SimpleSemaphore) = taking(l.accesses)
207-
realeasing(l::SimpleSemaphore) = Return(nothing) putting(l.accesses)
207+
releasing(l::SimpleSemaphore) = Return(nothing) putting(l.accesses)
208208

209209
Base.acquire(l::SimpleSemaphore) = acquiring(l)()
210-
Base.release(l::SimpleSemaphore) = realeasing(l)()
210+
Base.release(l::SimpleSemaphore) = releasing(l)()
211211

212212
# Unlike `SimpleLock`, we can acquire `SimpleSemaphore(n)` `n` times before
213213
# blocked:
@@ -238,13 +238,13 @@ struct ChLock <: Base.AbstractLock
238238
end
239239

240240
acquiring(l::ChLock) = l.acq
241-
realeasing(l::ChLock) = l.rel
241+
releasing(l::ChLock) = l.rel
242242

243243
Base.lock(l::ChLock) = acquiring(l)()
244-
Base.unlock(l::ChLock) = realeasing(l)()
244+
Base.unlock(l::ChLock) = releasing(l)()
245245

246246
# To create two kinds of locks, we create `2 * 2 = 4` channels. The state of
247-
# the lock is mantained by two blocking data structures (Note: We only need to
247+
# the lock is maintained by two blocking data structures (Note: We only need to
248248
# store at most one element. So, a stack is an overkill. But that's the most
249249
# cheap data structure we have implemented so far in the tutorial):
250250

@@ -323,7 +323,7 @@ function test_reader_writer_lock()
323323
sleep(0.1)
324324
@test !wlocked[]
325325
end
326-
@test r2() === r2() === :done # releaseing `rlock`
326+
@test r2() === r2() === :done # releasing `rlock`
327327
@test r1() == 3
328328
@test wlocked[]
329329

@@ -350,10 +350,10 @@ function test_reader_writer_lock()
350350
sleep(0.1)
351351
@test r4locked[] == r5locked[] == false
352352
end
353-
@test r2() === :done # releaseing `wlock`
353+
@test r2() === :done # releasing `wlock`
354354
@test sort!([r1(), r1()]) == [4, 5]
355355
@test r4locked[] == r5locked[] == true
356-
@test r2() === r2() === :done # releaseing `rlock`
356+
@test r2() === r2() === :done # releasing `rlock`
357357
end
358358
end
359359

examples/nack.jl

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function nack_demo()
3232
s1, r1 = Reagents.channel()
3333
s2, r2 = Reagents.channel()
3434
#=
35-
To receive the negative acknowledgement, we craete one more channel:
35+
To receive the negative acknowledgement, we create one more channel:
3636
=#
3737
send_gotnack, receive_gotnack = Reagents.channel()
3838
#=
@@ -55,7 +55,7 @@ function nack_demo()
5555
choice = br1 | br2
5656
#=
5757
Returning the reagents so that they can be invoked differently for trying
58-
differnt scenarios:
58+
different scenarios:
5959
=#
6060
return (; choice, s1, s2, receive_gotnack)
6161
end
@@ -131,7 +131,7 @@ function unique_id_provider!(request_receive, shutdown_receive)
131131
receive_request_or_shutdown = request_receive | shutdown_receive
132132
#=
133133
When the `shutdown_receive` reagent is chosen (i.e., the reaction result
134-
is `nothing`), the short-circuting `@something` evaluates the `break`
134+
is `nothing`), the short-circuiting `@something` evaluates the `break`
135135
statement so that the server exits the loop:
136136
=#
137137
(; reply, abort) = @something(receive_request_or_shutdown(), break)
@@ -235,7 +235,7 @@ function test_unique_id_provider()
235235
@test unique_id() == prev + 1
236236
break
237237
#=
238-
If `receive` was not tirggered, we keep the id `ans` so that it
238+
If `receive` was not triggered, we keep the id `ans` so that it
239239
can be used in the next iteration:
240240
=#
241241
else

examples/promises.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function test_promise_fetches()
2222
p = Promise{Int}()
2323

2424
#=
25-
Calling `fetch(p::Promise)` will wait for `p` to be fullfiled:
25+
Calling `fetch(p::Promise)` will wait for `p` to be fulfilled:
2626
=#
2727
task = @task fetch(p)
2828
yield(task)
@@ -62,7 +62,7 @@ function test_promise_close_before_fetches()
6262
close(p)
6363

6464
#=
65-
Then, previously blocked `fetch(::Promise)` rasies an exception:
65+
Then, previously blocked `fetch(::Promise)` raises an exception:
6666
=#
6767
err = try
6868
wait(t)

examples/treiberstack.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ function test_trypopping()
9090
=#
9191
@test trypopping(stack)(nothing) === Some(222)
9292
#=
93-
For convinience, `nothing` is the default argument when the reagent is
93+
For convenience, `nothing` is the default argument when the reagent is
9494
called without an argument:
9595
=#
9696
@test trypopping(stack)() === Some(111)

src/Reagents.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ struct Retry <: Failure end
1717
# The original implementation by Turon (2012) combines what is called `Reactor`
1818
# and `Reagent` here simply as reagent. This is structurally identical to how
1919
# Transducers.jl splits transducers (`Reagent` here) and reducing functions
20-
# (`Reactor` here). It makes implemneting the pairting combinator `&` (`Both`)
20+
# (`Reactor` here). It makes implementing the pairing combinator `&` (`Both`)
2121
# easier (which is similar to `Transducers.TeeZip`).
2222
struct Reactor{R<:Reagent,C}
2323
reagent::R
@@ -154,8 +154,8 @@ A module that re-exports a subset of Reagents public API at top-level.
154154
155155
Use `using Reagents.*` to import all public APIs. Do not use this inside a
156156
package. The set of exported names is not the part of stable API. For example,
157-
if a name collistion with `Base` or important packages are recognized, the
158-
corresponding name may be removed in the next realease, without incrementing
157+
if a name collision with `Base` or important packages are recognized, the
158+
corresponding name may be removed in the next release, without incrementing
159159
the leading non-zero version number.
160160
"""
161161
const * = __Reagents_API__

src/bags.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function Base.iterate(bag::Bag, (prev, curr) = (bag, @atomic bag.next))
3232
msgs = bag,
3333
)
3434
end
35-
# `prev` may be phisically removed while `curr` is phisically removed.
35+
# `prev` may be physically removed while `curr` is physically removed.
3636
# But this is OK since `curr` is already logically removed.
3737
# TODO: check this
3838
curr, ok = @atomicreplace(prev.next, curr => next)

src/computational.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ hascas(::Map) = false
6969
maysync(::Map) = false
7070
# `Map`, `Return`, etc. may return `Block` for nudging reactions to try other
7171
# branches (and also to indicate that `offer` is required). But these reagents
72-
# themselves do not attempt to sync. It *seems* like retruning `false` in this
72+
# themselves do not attempt to sync. It *seems* like returning `false` in this
7373
# case is more useful; see how `ReturnIfBlocked` use it for deadlock detection.
7474

7575
function tryreact!(actr::Reactor{<:Map}, a, rx::Reaction, offer::Union{Offer,Nothing})

src/reactions.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,14 @@ offerid(::Nothing) = UInt(0)
7272
* `offers::ImmutableList{Offer}`
7373
* `postcommithooks::ImmutableList{Any}`
7474
75-
* `restart_on_failure::Bool` (default: `false`): A flag controlling if the
75+
* `restart_on_failure::Bool` (default: `false`): A flag controling if the
7676
offer should be invalidated on the failure. Consider `(r | s) ⨟ t` where `s`
7777
and `t` both contain a `Swap`. When a `Swap` in `s` is triggered from the
7878
dual, it may indicate that `r` is now reactable (i.e., `s` is used as a
7979
condition variable). In this case, it is now required to register the offer
8080
at `t`. To support this behavior, `restart_on_failure` is set to `true` in
8181
the continuations of `Choice` (`|`). Then, in `tryreact!`, the offers of the
82-
dual messsage in `Swap` with `restart_on_failure` flag set are aborted. In
82+
dual message in `Swap` with `restart_on_failure` flag set are aborted. In
8383
particular, if the state is in `Waiting`, the task is re-scheduled so that
8484
other branches of `|` can be re-evaluated.
8585
"""

src/tracing.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ macro trace(args...)
1919
nothing
2020
end |> esc
2121
end
22-
# TODO: Use Preferences.jl to controll if Recalls.jl should be loaded? Since
22+
# TODO: Use Preferences.jl to control if Recalls.jl should be loaded? Since
2323
# `args` may affect what variables are captured in closures, the existence of
2424
# Recalls.jl changes the program slightly.
2525

test/ReagentsTests/src/test_cancellablecontainers.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ function check_repeat_cancellation(constructor, spawn::Bool; nitems = 100, rando
105105
push!(dest, y)
106106
randomize && random_sleep()
107107
end
108-
@debug "`check_repeat_cancellation`: Reciever $i done"
108+
@debug "`check_repeat_cancellation`: Receiver $i done"
109109
end
110110
end
111111

@@ -160,7 +160,7 @@ function check_repeat_cancellation(constructor, spawn::Bool; nitems = 100, rando
160160
push!(allreceived, something(y))
161161
nleft += 1
162162
end
163-
@debug "`check_repeat_cancellation`: $nleft items not recieved; $ncleaned refs cleaned"
163+
@debug "`check_repeat_cancellation`: $nleft items not received; $ncleaned refs cleaned"
164164

165165
# Not using `@test` to avoid overhead in while "fuzzing"
166166
@check length(allreceived) == length(allsent)

test/ReagentsTests/src/test_dualcontainers.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ function test_many_items(constructor, spawn::Bool, nrepeat = 1000)
104104
y == sentinel && break
105105
push!(dest, y)
106106
end
107-
@debug "`test_many_items`: Reciever $i done"
107+
@debug "`test_many_items`: Receiver $i done"
108108
end
109109
end
110110

@@ -147,7 +147,7 @@ function test_many_items(constructor, spawn::Bool, nrepeat = 1000)
147147
push!(allreceived, something(y))
148148
nleft += 1
149149
end
150-
@debug "`test_many_items`: $nleft items not recieved; $ncleaned refs cleaned"
150+
@debug "`test_many_items`: $nleft items not received; $ncleaned refs cleaned"
151151

152152
@test length(allreceived) == length(allsent)
153153
@test sort!(allreceived) == allsent

0 commit comments

Comments
 (0)