Skip to content

Commit

Permalink
Move thread stop to radiusd.c
Browse files Browse the repository at this point in the history
So we can see the entire build up / tear down in radiusd.c
  • Loading branch information
alandekok committed Nov 10, 2015
1 parent 36a35fd commit e4e6ffc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/main/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -5544,14 +5544,6 @@ void radius_event_free(void)
rbtree_walk(pl, RBTREE_DELETE_ORDER, request_delete_cb, NULL);

if (spawn_workers) {
/*
* Now that all requests have been marked "please stop",
* ensure that all of the threads have exited.
*/
#ifdef HAVE_PTHREAD_H
thread_pool_stop();
#endif

/*
* Walk the lists again, ensuring that all
* requests are done.
Expand Down
5 changes: 5 additions & 0 deletions src/main/radiusd.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,11 @@ int main(int argc, char *argv[])
* SEGVs.
*/
radius_event_free(); /* Free the requests */

#ifdef HAVE_PTHREAD_H
thread_pool_stop(); /* stop all the threads */
#endif

talloc_free(global_state); /* Free state entries */

cleanup:
Expand Down

0 comments on commit e4e6ffc

Please sign in to comment.