when reloading config file, there's a section of code that is supposed to wait for all threads to stop, however the condition is like this: if (!spawn_flag) for(;;) { // wait for thread here... } when I check where spawn_flag is set, I found that it's TRUE when multithread is supported, and FALSE when there is no thread. In this case, shouldn't here be "if (spawn_flag)" instead?? if (need_reload) { #ifdef HAVE_PTHREAD_H /* * Threads: wait for all threads to stop * processing before re-loading the * config, so we don't pull the rug out * from under them. */ int max_wait = 0; if (!spawn_flag) for(;;) { /* * Block until there are '0' threads * with a REQUEST handle. */ sig_hup_block = TRUE; if( (total_active_threads() == 0) || (max_wait >= 5) ) { sig_hup_block = FALSE; break; } sleep(1); max_wait++; } #endif Thanks, leo
Leo Lai wrote:
when reloading config file, there's a section of code that is supposed to wait for all threads to stop, however the condition is like this: if (!spawn_flag) for(;;) { // wait for thread here... } when I check where spawn_flag is set, I found that it's TRUE when multithread is supported, and FALSE when there is no thread. In this case, shouldn't here be "if (spawn_flag)" instead??
Yes, it has already been reported under bug #306 of the bugzilla. http://bugs.freeradius.org/show_bug.cgi?id=306 It will be fixed in 1.1.0. -- Nicolas Baradakis
participants (2)
-
Leo Lai -
Nicolas Baradakis