Skip to content

Commit

Permalink
Remove stale cglobal(:jl_tls_states) test (JuliaLang#43161)
Browse files Browse the repository at this point in the history
* Remove stale `cglobal(:jl_tls_states)` test
* Remove `jl_threading_enabled`
* The function `threadingOn()` in `julia-config.jl` is the only reference
other than the tests just removed. It looks like `threadingOn` itself is
not used anywhere in the script.
  • Loading branch information
tkf committed Nov 20, 2021
1 parent feba260 commit 2a1197a
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 17 deletions.
2 changes: 0 additions & 2 deletions contrib/julia-config.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ const options = [
"--framework"
];

threadingOn() = ccall(:jl_threading_enabled, Cint, ()) != 0

function shell_escape(str)
str = replace(str, "'" => "'\''")
return "'$str'"
Expand Down
1 change: 0 additions & 1 deletion src/jl_exported_funcs.inc
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,6 @@
XX(jl_task_stack_buffer) \
XX(jl_test_cpu_feature) \
XX(jl_threadid) \
XX(jl_threading_enabled) \
XX(jl_throw) \
XX(jl_throw_out_of_memory_error) \
XX(jl_too_few_args) \
Expand Down
5 changes: 0 additions & 5 deletions src/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -916,11 +916,6 @@ JL_DLLEXPORT size_t jl_maxrss(void)
#endif
}

JL_DLLEXPORT int jl_threading_enabled(void)
{
return 1;
}

#ifdef __cplusplus
}
#endif
9 changes: 0 additions & 9 deletions test/threads_exec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -517,15 +517,6 @@ if cfunction_closure
test_thread_cfunction()
end

# Compare the two ways of checking if threading is enabled.
# `jl_tls_states` should only be defined on non-threading build.
if ccall(:jl_threading_enabled, Cint, ()) == 0
@test nthreads() == 1
cglobal(:jl_tls_states) != C_NULL
else
@test_throws ErrorException cglobal(:jl_tls_states)
end

function test_thread_range()
a = zeros(Int, nthreads())
@threads for i in 1:threadid()
Expand Down

0 comments on commit 2a1197a

Please sign in to comment.