static TidStatus *g_tid_status;
static int g_all_tid_num;
-#define MAX_SIG_WAIT_TIME 1000
+#define MAX_SIG_WAIT_TIME 5000 // times 2 ms thats 10 seconds
// Hackish, but decided NOT to use signal SIGSETXID used by glibc
// as this was proven to cause interference with app candidate
g_threads_count -= threads_gone;
LogDebug("number of threads already gone (signals unsent): " << threads_gone);
- for (int i = MAX_SIG_WAIT_TIME; g_threads_count && i; i--)
+ unsigned counter = 0;
+ for (int i = MAX_SIG_WAIT_TIME; g_threads_count && i; i--) {
usleep(2000); // 2 ms
+ counter++;
+ if (counter == 500) {
+ counter = 0; // reset counter each ~1 second and add warning log
+ LogWarning("Not all threads synchronized yet, still waiting - threads left: " << g_threads_count);
+ }
+ }
Syscall::sigaction(SIGNAL_NUM, &old, nullptr);