#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util-scheduler", syscall)
-#ifdef LINUX
+#if HAVE_EXECINFO_H
#include "execinfo.h"
/**
GNUNET_assert (pos != NULL); /* ready_count wrong? */
ready[p] = pos->next;
ready_count--;
- if (current_priority != pos->priority)
- {
- current_priority = pos->priority;
- (void) GNUNET_OS_set_process_priority (GNUNET_OS_process_current (),
- pos->priority);
- }
+ current_priority = pos->priority;
current_lifeness = pos->lifeness;
active_task = pos;
#if PROFILE_DELAYS
if (GNUNET_TIME_absolute_get_duration (pos->start_time).rel_value >
DELAY_THRESHOLD.rel_value)
{
- LOG (GNUNET_ERROR_TYPE_ERROR, "Task %llu took %llums to be scheduled\n",
- pos->id,
- (unsigned long long)
- GNUNET_TIME_absolute_get_duration (pos->start_time).rel_value);
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "Task %llu took %s to be scheduled\n",
+ (unsigned long long) pos->id,
+ GNUNET_STRINGS_relative_time_to_string (GNUNET_TIME_absolute_get_duration (pos->start_time), GNUNET_YES));
}
#endif
tc.reason = pos->reason;
GNUNET_DISK_PIPE_END_READ);
GNUNET_assert (pr != NULL);
my_pid = getpid ();
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "Registering signal handlers\n");
shc_int = GNUNET_SIGNAL_handler_install (SIGINT, &sighandler_shutdown);
shc_term = GNUNET_SIGNAL_handler_install (SIGTERM, &sighandler_shutdown);
#ifndef MINGW
* either the delay has expired or the socket operation is ready. It
* will be run with the DEFAULT priority.
*
- * * @param delay when should this operation time out? Use
+ * @param delay when should this operation time out? Use
* GNUNET_TIME_UNIT_FOREVER_REL for "on shutdown"
+ * @param priority priority to use for the task
* @param rfd read file-descriptor
* @param task main function of the task
* @param task_cls closure of task
void *backtrace_array[MAX_TRACE_DEPTH];
#endif
- GNUNET_assert (active_task != NULL);
+ GNUNET_assert (NULL != active_task);
GNUNET_assert (NULL != task);
t = GNUNET_malloc (sizeof (struct Task));
t->callback = task;