54,6 → 54,8 |
#include <func.h> |
#include <string.h> |
#include <syscall/copy.h> |
#include <macros.h> |
#include <ipc/event.h> |
|
/** Spinlock protecting the tasks_tree AVL tree. */ |
SPINLOCK_INITIALIZE(tasks_lock); |
197,6 → 199,13 |
spinlock_unlock(&tasks_lock); |
interrupts_restore(ipl); |
|
/* |
* Notify about task creation. |
*/ |
if (event_is_subscribed(EVENT_WAIT)) |
event_notify_3(EVENT_WAIT, TASK_CREATE, LOWER32(ta->taskid), |
UPPER32(ta->taskid)); |
|
return ta; |
} |
|
229,6 → 238,13 |
if (atomic_predec(&t->as->refcount) == 0) |
as_destroy(t->as); |
|
/* |
* Notify about task destruction. |
*/ |
if (event_is_subscribed(EVENT_WAIT)) |
event_notify_3(EVENT_WAIT, TASK_DESTROY, LOWER32(t->taskid), |
UPPER32(t->taskid)); |
|
free(t); |
TASK = NULL; |
} |