#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include "uloop.h"
#include "runqueue.h"
Go to the source code of this file.
◆ add_sleeper()
static void add_sleeper |
( |
int |
val | ) |
|
|
static |
Definition at line 117 of file test-runqueue.c.
void runqueue_task_add(struct runqueue *q, struct runqueue_task *t, bool running)
void runqueue_process_kill_cb(struct runqueue *q, struct runqueue_task *t)
struct runqueue_task task
void(* run)(struct runqueue *q, struct runqueue_task *t)
struct runqueue_process proc
static struct sleeper * create_sleeper(int val, const struct runqueue_task_type *type, bool kill)
static void q_sleep_run(struct runqueue *q, struct runqueue_task *t)
static void my_runqueue_process_kill_cb(struct runqueue *q, struct runqueue_task *p)
static void q_sleep_cancel(struct runqueue *q, struct runqueue_task *t, int type)
static const char * sleeper_type(struct sleeper *s)
int uloop_timeout_add(struct uloop_timeout *timeout)
int uloop_timeout_set(struct uloop_timeout *timeout, int msecs)
◆ create_sleeper()
Definition at line 104 of file test-runqueue.c.
106 struct sleeper *s = calloc(1,
sizeof(*s));
const struct runqueue_task_type * type
void(* complete)(struct runqueue *q, struct runqueue_task *t)
static void timer_cb(struct uloop_timeout *t)
static void q_sleep_complete(struct runqueue *q, struct runqueue_task *p)
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 140 of file test-runqueue.c.
void runqueue_init(struct runqueue *q)
void(* empty_cb)(struct runqueue *q)
static void q_empty(struct runqueue *q)
static void add_sleeper(int val)
static int uloop_run(void)
◆ my_runqueue_process_kill_cb()
Definition at line 88 of file test-runqueue.c.
92 fprintf(stderr,
"[%d/%d] killing process (%s)\n",
q->
running_tasks,
#define container_of(ptr, type, member)
◆ q_empty()
static void q_empty |
( |
struct runqueue * |
q | ) |
|
|
static |
Definition at line 36 of file test-runqueue.c.
38 fprintf(stderr,
"All done!\n");
static void uloop_end(void)
◆ q_sleep_cancel()
Definition at line 70 of file test-runqueue.c.
74 fprintf(stderr,
"[%d/%d] cancel 'sleep %d' (%s)\n",
q->
running_tasks,
void runqueue_process_cancel_cb(struct runqueue *q, struct runqueue_task *t, int type)
◆ q_sleep_complete()
◆ q_sleep_run()
Definition at line 47 of file test-runqueue.c.
53 fprintf(stderr,
"[%d/%d] start 'sleep %d' (%s)\n",
q->
running_tasks,
65 sprintf(str,
"%d", s->
val);
66 execlp(
"sleep",
"sleep", str, NULL);
void runqueue_process_add(struct runqueue *q, struct runqueue_process *p, pid_t pid)
◆ sleeper_type()
static const char* sleeper_type |
( |
struct sleeper * |
s | ) |
|
|
static |
◆ timer_cb()
Definition at line 97 of file test-runqueue.c.
void runqueue_task_kill(struct runqueue_task *t)