struct task;
struct buffer;
+extern volatile unsigned long threads_to_dump;
void ha_task_dump(struct buffer *buf, const struct task *task, const char *pfx);
void ha_thread_dump(struct buffer *buf, int thr, int calling_tid);
void ha_thread_dump_all_to_trash();
#include <proto/stream_interface.h>
#include <proto/task.h>
+/* mask of threads still having to dump, used to respect ordering. Only used
+ * when USE_THREAD_DUMP is set.
+ */
+volatile unsigned long threads_to_dump = 0;
+
/* Dumps to the buffer some known information for the desired thread, and
* optionally extra info for the current thread. The dump will be appended to
* the buffer, so the caller is responsible for preliminary initializing it.
*/
#define DEBUGSIG SIGURG
-/* mask of threads still having to dump, used to respect ordering */
-static volatile unsigned long threads_to_dump;
-
/* ID of the thread requesting the dump */
static unsigned int thread_dump_tid;
if (n - p < 1000000000UL)
goto update_and_leave;
- if ((threads_harmless_mask|sleeping_thread_mask) & (1UL << thr)) {
+ if ((threads_harmless_mask|sleeping_thread_mask|threads_to_dump) & (1UL << thr)) {
/* This thread is currently doing exactly nothing
* waiting in the poll loop (unlikely but possible),
* waiting for all other threads to join the rendez-vous