Skip to content

Commit fae5cec

Browse files
authored
Merge pull request #61 from krynju/kr/finalizer-fixup
[swap-to-disk] Task switch in finalizer fix
2 parents c9c1139 + bc35995 commit fae5cec

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name = "MemPool"
22
uuid = "f9f48841-c794-520a-933b-121f7ba6ed94"
33
license = "MIT"
44
desc = "a simple distributed data store"
5-
version = "0.4.0"
5+
version = "0.4.1"
66

77
[deps]
88
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"

src/datastore.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -503,19 +503,19 @@ function _getlocal(id, remote)
503503
end
504504

505505
function datastore_delete(id; force=false)
506-
with_lock(datastore_counters_lock) do
506+
@safe_lock_spin datastore_counters_lock begin
507507
DEBUG_REFCOUNTING[] && _enqueue_work(Core.print, "-- (", myid(), ", ", id, ") with ", string(datastore_counters[(myid(), id)]), "\n"; gc_context=true)
508508
delete!(datastore_counters, (myid(), id))
509509
end
510-
state = with_lock(datastore_lock) do
510+
state = @safe_lock_spin datastore_lock begin
511511
haskey(datastore, id) ? datastore[id] : nothing
512512
end
513513
(state === nothing) && return
514514
device = storage_read(state).root
515515
if device !== nothing
516516
errormonitor(Threads.@spawn delete_from_device!(device, state, id))
517517
end
518-
with_lock(datastore_lock) do
518+
@safe_lock_spin datastore_lock begin
519519
haskey(datastore, id) && delete!(datastore, id)
520520
end
521521
# TODO: maybe cleanup from the who_has_read list?

0 commit comments

Comments
 (0)