#include "gnunet_signal_lib.h"
#include "gnunet_time_lib.h"
#include "disk.h"
-#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
-#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util", syscall)
-#ifdef LINUX
-#include "execinfo.h"
+#define LOG(kind,...) GNUNET_log_from (kind, "util-scheduler", __VA_ARGS__)
+#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util-scheduler", syscall)
+#ifdef LINUX
+#include "execinfo.h"
+
/**
* Use lsof to generate file descriptor reports on select error?
* (turn off for stable releases).
/**
* Check each file descriptor before adding
*/
-#define DEBUG_FDS GNUNET_EXTRA_LOGGING
+#define DEBUG_FDS GNUNET_NO
/**
* Depth of the traces collected via EXECINFO.
#define MAX_TRACE_DEPTH 50
#endif
-#define DEBUG_TASKS GNUNET_EXTRA_LOGGING
-
/**
* Should we figure out which tasks are delayed for a while
* before they are run? (Consider using in combination with EXECINFO).
*/
#define DELAY_THRESHOLD GNUNET_TIME_UNIT_SECONDS
+
/**
* Linked list of pending tasks.
*/
pos = pending;
while (pos != NULL)
{
-#if DEBUG_TASKS
- LOG (GNUNET_ERROR_TYPE_DEBUG, "Checking readiness of task: %llu / %p\n",
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "Checking readiness of task: %llu / %p\n",
pos->id, pos->callback_cls);
-#endif
next = pos->next;
if (GNUNET_YES == is_ready (pos, now, rs, ws))
{
(pos->write_fd != -1) &&
(!GNUNET_NETWORK_fdset_test_native (ws, pos->write_fd)))
GNUNET_abort (); // added to ready in previous select loop!
-#if DEBUG_TASKS
- LOG (GNUNET_ERROR_TYPE_DEBUG, "Running task: %llu / %p\n", pos->id,
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "Running task: %llu / %p\n", pos->id,
pos->callback_cls);
-#endif
pos->callback (pos->callback_cls, &tc);
#if EXECINFO
int i;
rs = GNUNET_NETWORK_fdset_create ();
ws = GNUNET_NETWORK_fdset_create ();
GNUNET_assert (shutdown_pipe_handle == NULL);
- shutdown_pipe_handle = GNUNET_DISK_pipe (GNUNET_NO, GNUNET_NO, GNUNET_NO);
+ shutdown_pipe_handle = GNUNET_DISK_pipe (GNUNET_NO, GNUNET_NO, GNUNET_NO, GNUNET_NO);
GNUNET_assert (shutdown_pipe_handle != NULL);
pr = GNUNET_DISK_pipe_handle (shutdown_pipe_handle,
GNUNET_DISK_PIPE_END_READ);
current_lifeness = GNUNET_YES;
GNUNET_SCHEDULER_add_continuation (task, task_cls,
GNUNET_SCHEDULER_REASON_STARTUP);
-#if ENABLE_WINDOWS_WORKAROUNDS
active_task = (void *) (long) -1; /* force passing of sanity check */
GNUNET_SCHEDULER_add_now_with_lifeness (GNUNET_NO,
&GNUNET_OS_install_parent_control_handler,
NULL);
active_task = NULL;
-#endif
last_tr = 0;
busy_wait_warning = 0;
while (GNUNET_OK == check_lifeness ())
prev->next = t->next;
}
ret = t->callback_cls;
-#if DEBUG_TASKS
LOG (GNUNET_ERROR_TYPE_DEBUG, "Canceling task: %llu / %p\n", task,
t->callback_cls);
-#endif
destroy_task (t);
return ret;
}
t->reason = reason;
t->priority = priority;
t->lifeness = current_lifeness;
-#if DEBUG_TASKS
LOG (GNUNET_ERROR_TYPE_DEBUG, "Adding continuation task: %llu / %p\n", t->id,
t->callback_cls);
-#endif
queue_ready_task (t);
}
/* hyper-optimization... */
pending_timeout_last = t;
-#if DEBUG_TASKS
LOG (GNUNET_ERROR_TYPE_DEBUG, "Adding task: %llu / %p\n", t->id,
t->callback_cls);
-#endif
#if EXECINFO
int i;
t->next = pending;
pending = t;
max_priority_added = GNUNET_MAX (max_priority_added, t->priority);
-#if DEBUG_TASKS
LOG (GNUNET_ERROR_TYPE_DEBUG, "Adding task: %llu / %p\n", t->id,
t->callback_cls);
-#endif
#if EXECINFO
int i;
t->next = pending;
pending = t;
max_priority_added = GNUNET_MAX (max_priority_added, t->priority);
-#if DEBUG_TASKS
LOG (GNUNET_ERROR_TYPE_DEBUG, "Adding task: %llu / %p\n", t->id,
t->callback_cls);
-#endif
#if EXECINFO
int i;