diff --git a/src/jl_exported_funcs.inc b/src/jl_exported_funcs.inc index cba609be50c5f..ac004cda653b7 100644 --- a/src/jl_exported_funcs.inc +++ b/src/jl_exported_funcs.inc @@ -103,6 +103,7 @@ XX(jl_copy_ast) \ XX(jl_copy_code_info) \ XX(jl_cpu_threads) \ + XX(jl_effective_threads) \ XX(jl_crc32c_sw) \ XX(jl_create_system_image) \ XX(jl_cstr_to_string) \ diff --git a/src/julia.h b/src/julia.h index 863e9c8de7cbb..4b5948583bf9c 100644 --- a/src/julia.h +++ b/src/julia.h @@ -1635,6 +1635,7 @@ JL_DLLEXPORT int jl_errno(void) JL_NOTSAFEPOINT; JL_DLLEXPORT void jl_set_errno(int e) JL_NOTSAFEPOINT; JL_DLLEXPORT int32_t jl_stat(const char *path, char *statbuf) JL_NOTSAFEPOINT; JL_DLLEXPORT int jl_cpu_threads(void) JL_NOTSAFEPOINT; +JL_DLLEXPORT int jl_effective_threads(void) JL_NOTSAFEPOINT; JL_DLLEXPORT long jl_getpagesize(void) JL_NOTSAFEPOINT; JL_DLLEXPORT long jl_getallocationgranularity(void) JL_NOTSAFEPOINT; JL_DLLEXPORT int jl_is_debugbuild(void) JL_NOTSAFEPOINT; diff --git a/src/sys.c b/src/sys.c index 8f2be76e648c8..ffd43b36d4f68 100644 --- a/src/sys.c +++ b/src/sys.c @@ -436,7 +436,7 @@ JL_DLLEXPORT int jl_cpu_threads(void) JL_NOTSAFEPOINT #endif } -int jl_effective_threads(void) JL_NOTSAFEPOINT +JL_DLLEXPORT int jl_effective_threads(void) JL_NOTSAFEPOINT { int cpu = jl_cpu_threads(); int masksize = uv_cpumask_size(); diff --git a/test/cmdlineargs.jl b/test/cmdlineargs.jl index 8d58672d30f09..e16573bfbe70a 100644 --- a/test/cmdlineargs.jl +++ b/test/cmdlineargs.jl @@ -218,7 +218,7 @@ let exename = `$(Base.julia_cmd()) --startup-file=no --color=no` # -t, --threads code = "print(Threads.nthreads())" - cpu_threads = ccall(:jl_cpu_threads, Int32, ()) + cpu_threads = ccall(:jl_effective_threads, Int32, ()) @test string(cpu_threads) == read(`$exename --threads auto -e $code`, String) == read(`$exename --threads=auto -e $code`, String) ==