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 #7466.
Closes #8510.
  • Loading branch information
josevalim committed Oct 25, 2024
1 parent 471b366 commit 72f2c90
Show file tree
Hide file tree
Showing 3 changed files with 283 additions and 198 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 72f2c90

Please sign in to comment.