JuliaFolds2 / OhMyThreads.jl

Simple multithreading in julia
https://juliafolds2.github.io/OhMyThreads.jl/
MIT License
139 stars 9 forks source link

Clarify the scope of `@set` and `@local` #126

Closed fredrikekre closed 1 month ago

fredrikekre commented 1 month ago

This patch adds a clarification about the scope of the right hand sides of @set and @local right hand sides.

I had some code similar to

function f()
    x = foo()
    @tasks for i in 1:3
        @local y = bar(x)
        local x = baz()
    end
end

which looks like it wouldn't work because x in bar(x) would normally throw an UndefVarError.

MasonProtter commented 1 month ago

Great catch, LGTM.

codecov-commenter commented 1 month ago

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 86.01%. Comparing base (cba9127) to head (2c6c0ea). Report is 126 commits behind head on master.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #126 +/- ## ========================================== - Coverage 90.24% 86.01% -4.23% ========================================== Files 3 7 +4 Lines 82 572 +490 ========================================== + Hits 74 492 +418 - Misses 8 80 +72 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.