projects
/
paraslash.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
afh: Move audio_format_name() up.
[paraslash.git]
/
sched.c
diff --git
a/sched.c
b/sched.c
index 268ba5418a5a01a7fcbab640bb072e009a67ee60..a2903940fdaea1b24d6a49cfc2f54766c136070f 100644
(file)
--- a/
sched.c
+++ b/
sched.c
@@
-1,13
+1,8
@@
-/*
- * Copyright (C) 2006-2014 Andre Noll <maan@tuebingen.mpg.de>
- *
- * Licensed under the GPL v2. For licencing details see COPYING.
- */
+/* Copyright (C) 2006 Andre Noll <maan@tuebingen.mpg.de>, see file COPYING. */
/** \file sched.c Paraslash's scheduling functions. */
#include <regex.h>
/** \file sched.c Paraslash's scheduling functions. */
#include <regex.h>
-#include <assert.h>
#include "para.h"
#include "ipc.h"
#include "para.h"
#include "ipc.h"
@@
-51,12
+46,6
@@
struct task {
static struct timeval now_struct;
const struct timeval *now = &now_struct;
static struct timeval now_struct;
const struct timeval *now = &now_struct;
-static inline bool timeout_is_zero(struct sched *s)
-{
- struct timeval *tv = &s->select_timeout;
- return tv->tv_sec == 0 && tv->tv_usec == 0;
-}
-
static void sched_preselect(struct sched *s)
{
struct task *t, *tmp;
static void sched_preselect(struct sched *s)
{
struct task *t, *tmp;
@@
-73,7
+62,10
@@
static void sched_preselect(struct sched *s)
static void unlink_and_free_task(struct task *t)
{
static void unlink_and_free_task(struct task *t)
{
- PARA_INFO_LOG("freeing task %s\n", t->name);
+ PARA_INFO_LOG("freeing task %s (%s)\n", t->name, t->status < 0?
+ para_strerror(-t->status) :
+ (t->status == TS_DEAD? "[dead]" : "[running]"));
+
list_del(&t->node);
free(t->name);
free(t);
list_del(&t->node);
free(t->name);
free(t);
@@
-176,7
+168,7
@@
again:
* \param tptr Identifies the task to reap.
*
* This function is similar to wait(2) in that it returns information about a
* \param tptr Identifies the task to reap.
*
* This function is similar to wait(2) in that it returns information about a
- * terminated task
and allows to release
the resources associated with the
+ * terminated task
which allows releasing
the resources associated with the
* task. Until this function is called, the terminated task remains in a zombie
* state.
*
* task. Until this function is called, the terminated task remains in a zombie
* state.
*
@@
-391,7
+383,7
@@
void sched_min_delay(struct sched *s)
* function does nothing. Otherwise the timeout for the next select() call is
* set to the given value.
*
* function does nothing. Otherwise the timeout for the next select() call is
* set to the given value.
*
- * \sa sched_request_timeout_ms().
+ * \sa
\ref
sched_request_timeout_ms().
*/
void sched_request_timeout(struct timeval *to, struct sched *s)
{
*/
void sched_request_timeout(struct timeval *to, struct sched *s)
{
@@
-424,7
+416,7
@@
void sched_request_timeout_ms(long unsigned ms, struct sched *s)
* \return If \a barrier is in the past, this function does nothing and returns
* zero. Otherwise it returns one.
*
* \return If \a barrier is in the past, this function does nothing and returns
* zero. Otherwise it returns one.
*
- * \sa sched_request_barrier_or_min_delay().
+ * \sa
\ref
sched_request_barrier_or_min_delay().
*/
int sched_request_barrier(struct timeval *barrier, struct sched *s)
{
*/
int sched_request_barrier(struct timeval *barrier, struct sched *s)
{
@@
-445,7
+437,7
@@
int sched_request_barrier(struct timeval *barrier, struct sched *s)
* \return If \a barrier is in the past, this function requests a minimal
* timeout and returns zero. Otherwise it returns one.
*
* \return If \a barrier is in the past, this function requests a minimal
* timeout and returns zero. Otherwise it returns one.
*
- * \sa
sched_min_delay(),
sched_request_barrier().
+ * \sa
\ref sched_min_delay(), \ref
sched_request_barrier().
*/
int sched_request_barrier_or_min_delay(struct timeval *barrier, struct sched *s)
{
*/
int sched_request_barrier_or_min_delay(struct timeval *barrier, struct sched *s)
{