summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--firmware/export/kernel.h1
-rw-r--r--firmware/kernel.c20
-rw-r--r--uisimulator/sdl/kernel.c5
-rw-r--r--uisimulator/win32/kernel.c5
-rw-r--r--uisimulator/x11/kernel.c5
5 files changed, 36 insertions, 0 deletions
diff --git a/firmware/export/kernel.h b/firmware/export/kernel.h
index 42d160bcea..5cd3c6dc94 100644
--- a/firmware/export/kernel.h
+++ b/firmware/export/kernel.h
@@ -86,6 +86,7 @@ int tick_add_task(void (*f)(void));
int tick_remove_task(void (*f)(void));
extern void queue_init(struct event_queue *q);
+extern void queue_delete(struct event_queue *q);
extern void queue_wait(struct event_queue *q, struct event *ev);
extern void queue_wait_w_tmo(struct event_queue *q, struct event *ev, int ticks);
extern void queue_post(struct event_queue *q, long id, void *data);
diff --git a/firmware/kernel.c b/firmware/kernel.c
index b30a3bb12b..f8b9cec2e1 100644
--- a/firmware/kernel.c
+++ b/firmware/kernel.c
@@ -83,6 +83,26 @@ void queue_init(struct event_queue *q)
all_queues[num_queues++] = q;
}
+void queue_delete(struct event_queue *q)
+{
+ int i;
+
+ /* Find the queue to be deleted */
+ for(i = 0;i < num_queues;i++)
+ {
+ if(all_queues[i] == q)
+ break;
+ }
+
+ /* Move the following queues up in the list */
+ for(;i < num_queues-1;i++)
+ {
+ all_queues[i] = all_queues[i+1];
+ }
+
+ num_queues--;
+}
+
void queue_wait(struct event_queue *q, struct event *ev)
{
while(q->read == q->write)
diff --git a/uisimulator/sdl/kernel.c b/uisimulator/sdl/kernel.c
index 25f2df220c..947d82a550 100644
--- a/uisimulator/sdl/kernel.c
+++ b/uisimulator/sdl/kernel.c
@@ -36,6 +36,11 @@ void queue_init(struct event_queue *q)
q->write = 0;
}
+void queue_delete(struct event_queue *q)
+{
+ (void)q;
+}
+
void queue_wait(struct event_queue *q, struct event *ev)
{
while(q->read == q->write)
diff --git a/uisimulator/win32/kernel.c b/uisimulator/win32/kernel.c
index eb55bf7a72..08b3114f08 100644
--- a/uisimulator/win32/kernel.c
+++ b/uisimulator/win32/kernel.c
@@ -43,6 +43,11 @@ void queue_init(struct event_queue *q)
q->write = 0;
}
+void queue_delete(struct event_queue *q)
+{
+ (void)q;
+}
+
void queue_wait(struct event_queue *q, struct event *ev)
{
while(q->read == q->write)
diff --git a/uisimulator/x11/kernel.c b/uisimulator/x11/kernel.c
index 25f2df220c..947d82a550 100644
--- a/uisimulator/x11/kernel.c
+++ b/uisimulator/x11/kernel.c
@@ -36,6 +36,11 @@ void queue_init(struct event_queue *q)
q->write = 0;
}
+void queue_delete(struct event_queue *q)
+{
+ (void)q;
+}
+
void queue_wait(struct event_queue *q, struct event *ev)
{
while(q->read == q->write)