Skip to content

Commit 8a4b329

Browse files
authored
Merge pull request #56 from krynju/kr/spin-only-in-finalizer
Trylock loops only in the finalizer
2 parents a28f2bc + 3ebacb1 commit 8a4b329

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/datastore.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ function poolref_owner(id::Int)
155155
end
156156
function poolunref(d::DRef, to_pid=0)
157157
@assert haskey(local_datastore_counter, (d.owner,d.id)) "poolunref called before any poolref $(myid()): ($(d.owner),$(d.id))"
158-
with_datastore_lock() do
158+
@safe_lock_spin datastore_lock[] begin
159159
ctr = local_datastore_counter[(d.owner,d.id)]
160160
atomic_sub!(ctr, 1)
161161
if ctr[] == 0
@@ -215,7 +215,7 @@ end
215215

216216
if VERSION >= v"1.3.0-DEV"
217217
function with_datastore_lock(f)
218-
@safe_lock_spin datastore_lock[] begin
218+
@safe_lock datastore_lock[] begin
219219
f()
220220
end
221221
end

0 commit comments

Comments
 (0)