Skip to content

Commit

Permalink
Merge pull request #53 from JeffBezanson/jb/fix52
Browse files Browse the repository at this point in the history
fix #52, bad ccall with julia v1.7
  • Loading branch information
jpsamaroo authored Jun 30, 2021
2 parents f62e3ec + 4017f5b commit ad20954
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ os:
- osx
julia:
- 1.0
- 1.1
- 1.2
- 1.3
- 1.6
- nightly
notifications:
email: false
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = "MemPool"
uuid = "f9f48841-c794-520a-933b-121f7ba6ed94"
license = "MIT"
desc = "a simple distributed data store"
version = "0.3.4"
version = "0.3.5"

[deps]
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Expand Down
5 changes: 2 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
environment:
matrix:
- julia_version: 1.0
- julia_version: 1.1
- julia_version: 1.2
- julia_version: 1.3
- julia_version: latest
- julia_version: 1.6
- julia_version: nightly

platform:
- x86 # 32-bit
Expand Down
6 changes: 6 additions & 0 deletions src/lock.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,17 @@ end

Base.unlock(nrl::NonReentrantLock) = unlock(nrl.rl)

if VERSION >= v"1.7.0-DEV"
# as of v1.7 locks in Base disable finalizers
enable_finalizers(on::Bool) = nothing
else
# NonReentrantLock may be taken around code that might call the GC, which might
# reenter through finalizers. Avoid that by temporarily disabling finalizers
# running concurrently on this thread.
enable_finalizers(on::Bool) = ccall(:jl_gc_enable_finalizers, Cvoid,
(Ptr{Cvoid}, Int32,), Core.getptls(), on)
end

macro safe_lock(l, ex)
quote
temp = $(esc(l))
Expand Down

2 comments on commit ad20954

@jpsamaroo
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/39974

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.3.5 -m "<description of version>" ad209541533ec3bbbe18af7b7a8066a2c673cfaa
git push origin v0.3.5

Please sign in to comment.