Skip to content

Commit

Permalink
Refactor code server to use a single queue
Browse files Browse the repository at this point in the history
Prior to this patch, the code server had two
internal queues, one to track module loading
and another to track on_load callbacks. This
pull requests refactors the code to have a
single queue, in order to fix bugs and improve
maintainability.

Closes erlang#7466.
Closes erlang#8510.
  • Loading branch information
josevalim committed Aug 25, 2024
1 parent 34e3822 commit 6baba91
Show file tree
Hide file tree
Showing 3 changed files with 196 additions and 197 deletions.
5 changes: 3 additions & 2 deletions lib/kernel/src/code.erl
Original file line number Diff line number Diff line change
Expand Up @@ -563,9 +563,10 @@ ensure_loaded(Mod) when is_atom(Mod) ->
{Binary,File,Ref} ->
case ensure_prepare_loading(Mod, Binary, File) of
{error,_}=Error ->
call({load_error, Ref, Mod, Error});
call({load_error, Mod, Ref}),
Error;
Prepared ->
call({load_module, Prepared, Mod, File, false, Ref})
call({load_ok, Prepared, Mod, File, Ref})
end
end;
embedded ->
Expand Down
Loading

0 comments on commit 6baba91

Please sign in to comment.