Skip to content

Commit

Permalink
halcmd: on unload all, delete all threads first
Browse files Browse the repository at this point in the history
This terminates threads which are blocked in a thread function (read, poll)
so the underlying component/shared library can be safely dlclose()'d

see also: machinekit/mksocfpga#45 (comment)
  • Loading branch information
Michael Haberler committed Jun 12, 2016
1 parent a4d2df8 commit 2b3d5d2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/hal/utils/halcmd_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -1507,6 +1507,9 @@ int do_unloadrt_cmd(char *mod_name)
while ((name = zlist_pop(vtables)) != NULL)
zlist_append(components, name);

if (all)
do_delthread_cmd("all");

/* we now have a list of components to do in-order, unload them */
retval1 = 0;
while ((name = zlist_pop(components)) != NULL) {
Expand Down

0 comments on commit 2b3d5d2

Please sign in to comment.