Skip to content

Commit db314e6

Browse files
author
KDr2
committed
compatibility to Julia 1.5
1 parent fbe3380 commit db314e6

File tree

4 files changed

+19
-15
lines changed

4 files changed

+19
-15
lines changed

.github/workflows/Testing.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
- '1.2'
2020
- '1.3'
2121
- '1.4'
22+
- '1.5'
23+
- 'nightly'
2224
os:
2325
- ubuntu-latest
2426
- windows-latest

deps/build.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ length(products_tmp) == 0 && (products_tmp = [products[end]])
2525
products = products_tmp
2626

2727
# Download binaries from hosted location
28-
bin_prefix = "https://github.com/JuliaBinaryWrappers/Libtask_jll.jl/releases/download/Libtask-v0.3.0+0"
28+
bin_prefix = "https://github.com/JuliaBinaryWrappers/Libtask_jll.jl/releases/download/Libtask-v0.3.1+0"
2929

3030
# Listing of files generated by BinaryBuilder:
3131
download_info = Dict(
32-
Linux(:aarch64, libc=:glibc) => ("$bin_prefix/Libtask.v0.3.0.aarch64-linux-gnu.tar.gz", "e541c0df11d48b45e9334018c014ae0d012b75f92ffbc49fc4ab6eed35593731"),
33-
Linux(:i686, libc=:glibc) => ("$bin_prefix/Libtask.v0.3.0.i686-linux-gnu.tar.gz", "7f68bd21609adf35878f9b16f56151ab5f6f609999a40291ed270c1a4d0331a0"),
34-
Windows(:i686) => ("$bin_prefix/Libtask.v0.3.0.i686-w64-mingw32.tar.gz", "62950b53a892fb8c699ddbb4ccc9f19b12681f64fbf85a546345d5b0f23dc8d7"),
35-
MacOS(:x86_64) => ("$bin_prefix/Libtask.v0.3.0.x86_64-apple-darwin14.tar.gz", "fff6523dde93e6dc12b96a8bf1e3c35a78d8dba7cdc95cd0e5dd13225d1972df"),
36-
Linux(:x86_64, libc=:glibc) => ("$bin_prefix/Libtask.v0.3.0.x86_64-linux-gnu.tar.gz", "be4c590e8f13df31855be20f31c1c4ce98f499fc5173cd35c8e8b72b79e0dc5a"),
37-
Windows(:x86_64) => ("$bin_prefix/Libtask.v0.3.0.x86_64-w64-mingw32.tar.gz", "267473eb211e5060b98cede7f30336d2a7453542617521f27941d353dcfe42e8"),
32+
Linux(:aarch64, libc=:glibc) => ("$bin_prefix/Libtask.v0.3.1.aarch64-linux-gnu.tar.gz", "ad342e90969280fcd198993947fb27a052357c278e40645574b93f13b9f49f25"),
33+
Linux(:i686, libc=:glibc) => ("$bin_prefix/Libtask.v0.3.1.i686-linux-gnu.tar.gz", "a4061a2098da96cd6c49300b2895a61ce02d822c603ba85995d300149c9cec5e"),
34+
Windows(:i686) => ("$bin_prefix/Libtask.v0.3.1.i686-w64-mingw32.tar.gz", "e38da986025dac5767da841cc3666973a303061f4b853c0821fc25de4802f674"),
35+
MacOS(:x86_64) => ("$bin_prefix/Libtask.v0.3.1.x86_64-apple-darwin14.tar.gz", "93bf6be03236252eea33998c5fa4f0a8173d44b20266e8e05473a2ae957eebde"),
36+
Linux(:x86_64, libc=:glibc) => ("$bin_prefix/Libtask.v0.3.1.x86_64-linux-gnu.tar.gz", "349fc5fdd1d1234f1c1467fd655b9a5e18ac926e5b16db4ba7743b75a9540739"),
37+
Windows(:x86_64) => ("$bin_prefix/Libtask.v0.3.1.x86_64-w64-mingw32.tar.gz", "837410807715caf15b931f04c968a3ca8967bd0d70df888d1ed535a1679030d0"),
3838
)
3939

4040
# Install unsatisfied or updated dependencies:

src/taskcopy.jl

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Utility function for self-copying mechanism
22

3-
n_copies() = n_copies(current_task())
3+
_current_task() = ccall((:vanilla_get_current_task, libtask), Ref{Task}, ())
4+
5+
n_copies() = n_copies(_current_task())
46
n_copies(t::Task) = begin
57
isa(t.storage, Nothing) && (t.storage = IdDict())
68
if haskey(t.storage, :n_copies)
@@ -34,14 +36,14 @@ proper way is refreshing the `current_task` (the variable `t`) in
3436
function task_wrapper(func)
3537
() ->
3638
try
37-
ct = current_task()
39+
ct = _current_task()
3840
res = func()
3941
ct.result = res
4042
isa(ct.storage, Nothing) && (ct.storage = IdDict())
4143
ct.storage[:_libtask_state] = :done
4244
wait()
4345
catch ex
44-
ct = current_task()
46+
ct = _current_task()
4547
ct.exception = ex
4648
ct.result = ex
4749
ct.backtrace = catch_backtrace()
@@ -92,7 +94,7 @@ function Base.show(io::IO, exc::CTaskException)
9294
end
9395

9496
produce(v) = begin
95-
ct = current_task()
97+
ct = _current_task()
9698

9799
if ct.storage == nothing
98100
ct.storage = IdDict()
@@ -126,7 +128,7 @@ produce(v) = begin
126128
if empty
127129
schedule(t, v)
128130
wait()
129-
ct = current_task() # When a task is copied, ct should be updated to new task ID.
131+
ct = _current_task() # When a task is copied, ct should be updated to new task ID.
130132
while true
131133
# wait until there are more consumers
132134
q = ct.storage[:consumers]
@@ -159,7 +161,7 @@ consume(p::Task, values...) = begin
159161
return wait(p)
160162
end
161163

162-
ct = current_task()
164+
ct = _current_task()
163165
ct.result = length(values)==1 ? values[1] : values
164166

165167
#### un-optimized version

test/tarray3.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ using Test
77
function f_ct()
88
ta = tzeros(UInt64, 4);
99
for i in 1:4
10-
ta[i] = hash(current_task())
11-
DATA[current_task()] = convert(Array, ta)
10+
ta[i] = hash(Libtask._current_task())
11+
DATA[Libtask._current_task()] = convert(Array, ta)
1212
produce(ta[i])
1313
end
1414
end

0 commit comments

Comments
 (0)