Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.openwrt.org/project/libubox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2016-07-29 13:00:15 +0300
committerFelix Fietkau <nbd@nbd.name>2016-07-29 13:01:37 +0300
commit290c64ef5b5c3e75be851594f269d6a9568e64e5 (patch)
treee83af18c6ef07c66e444ca7302f56ce8d6f45ed3 /runqueue.h
parent72613ca2c8f9b9905c6372c1b19ecbcd7cace007 (diff)
libubox: add static initializer macro for runqueues
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'runqueue.h')
-rw-r--r--runqueue.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/runqueue.h b/runqueue.h
index 0d4173d..f182e4e 100644
--- a/runqueue.h
+++ b/runqueue.h
@@ -90,6 +90,15 @@ struct runqueue_process {
struct uloop_process proc;
};
+#define RUNQUEUE_INIT(_name, _max_running) { \
+ .tasks_active = SAFE_LIST_INIT(_name.tasks_active), \
+ .tasks_inactive = SAFE_LIST_INIT(_name.tasks_inactive), \
+ .max_running_tasks = _max_running \
+ }
+
+#define RUNQUEUE(_name, _max_running) \
+ struct runqueue _name = RUNQUEUE_INIT(_name, _max_running)
+
void runqueue_init(struct runqueue *q);
void runqueue_cancel(struct runqueue *q);
void runqueue_cancel_active(struct runqueue *q);