You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
julia>using OhMyThreads
julia>@tasksfor i in1:8@set ntasks =2println(i, ": before")
@only_onebeginprintln(i, ": after")
endend5: before
1: before
5: after
2: before
3: before
6: before
6: after
7: before
7: after
8: before
4: before
8: after
julia>@tasksfor i in1:8@set ntasks =2println(i, ": before")
@only_onebeginprintln(i, ": after")
endend1: before
5: before
1: after
6: before
2: before
7: before
8: before
2: after
3: before
3: after
4: before
4: after
Doesn't work:
julia>functionf()
@tasksfor i in1:8@set ntasks =2println(i, ": before")
@only_onebeginprintln(i, ": after")
endendend
f (generic function with 1 method)
julia>f()
1: before
1: after
2: before
5: before
2: after
3: before
3: after
4: before
4: after
6: before
7: before
8: before
julia>f()
1: before
5: before
6: before
7: before
2: before
3: before
4: before
8: before
The text was updated successfully, but these errors were encountered:
julia>using OhMyThreads
julia>using OhMyThreads.Tools: OnlyOneRegion, try_enter!
julia>functiong()
r =OnlyOneRegion()
tforeach(1:8; ntasks=2) do _
println("A")
try_enter!(r) doprintln("B")
endendend
g (generic function with 1 method)
julia>g()
A
A
B
A
B
A
A
A
A
B
A
B
julia>g()
A
A
B
A
A
B
A
B
A
A
B
A
Works:
Doesn't work:
The text was updated successfully, but these errors were encountered: