Skip to content

Commit

Permalink
fixes for threads and tasks with trimming
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Sep 27, 2024
1 parent 4eaff42 commit a2cff4c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
5 changes: 5 additions & 0 deletions juliac/buildscript.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ end
init_active_project() = ACTIVE_PROJECT[] = nothing
set_active_project(projfile::Union{AbstractString,Nothing}) = ACTIVE_PROJECT[] = projfile
disable_library_threading() = nothing
start_profile_listener() = nothing
@inline function invokelatest(f::F, args...; kwargs...) where F
return f(args...; kwargs...)
end
Expand Down Expand Up @@ -198,6 +199,10 @@ let mod = Base.include(Base.__toplevel__, inputfile)
end
#entrypoint(join, (Base.GenericIOBuffer{Memory{UInt8}}, Array{Base.SubString{String}, 1}, String))
#entrypoint(join, (Base.GenericIOBuffer{Memory{UInt8}}, Array{String, 1}, Char))
entrypoint(Base.task_done_hook, (Task,))
entrypoint(Base.wait, ())
entrypoint(Base.trypoptask, (Base.StickyWorkqueue,))
entrypoint(Base.checktaskempty, ())
if add_ccallables
ccall(:jl_add_ccallable_entrypoints, Cvoid, ())
end
Expand Down
12 changes: 9 additions & 3 deletions src/staticdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -848,9 +848,15 @@ static void jl_queue_module_for_serialization(jl_serializer_state *s, jl_module_
}
if (jl_options.static_call_graph) {
jl_value_t *val = jl_get_binding_value(b);
if (jl_is_module(val) || !strcmp(jl_symbol_name(b->globalref->name), "__init__")) {
if (jl_options.verbose_compilation)
jl_(val);
// keep binding objects that are defined and ...
if (val &&
// ... point to modules ...
(jl_is_module(val) ||
// ... or point to __init__ methods ...
!strcmp(jl_symbol_name(b->globalref->name), "__init__") ||
// ... or point to Base functions accessed by the runtime
(m == jl_base_module && (!strcmp(jl_symbol_name(b->globalref->name), "wait") ||
!strcmp(jl_symbol_name(b->globalref->name), "task_done_hook"))))) {
jl_queue_for_serialization(s, b, m);
}
}
Expand Down

0 comments on commit a2cff4c

Please sign in to comment.