|
|
| version 1.4.2.2, 2012/01/08 02:52:29 | version 1.4.2.3, 2012/01/08 03:28:26 |
|---|---|
| Line 193 schedEnd(sched_root_task_t ** __restrict root) | Line 193 schedEnd(sched_root_task_t ** __restrict root) |
| if (!root || !*root) | if (!root || !*root) |
| return -1; | return -1; |
| #ifdef HAVE_LIBPTHREAD | |
| for (i = 0; i < taskMAX; i++) | |
| pthread_mutex_lock(&(*root)->root_mtx[i]); | |
| #endif | |
| TAILQ_FOREACH(task, &(*root)->root_read, task_node) { | TAILQ_FOREACH(task, &(*root)->root_read, task_node) { |
| schedCancel(task); | schedCancel(task); |
| } | } |
| Line 216 schedEnd(sched_root_task_t ** __restrict root) | Line 212 schedEnd(sched_root_task_t ** __restrict root) |
| schedCancel(task); | schedCancel(task); |
| } | } |
| #ifdef HAVE_LIBPTHREAD | |
| pthread_mutex_lock(&(*root)->root_mtx[taskUNUSE]); | |
| #endif | |
| while ((task = TAILQ_FIRST(&(*root)->root_unuse))) { | while ((task = TAILQ_FIRST(&(*root)->root_unuse))) { |
| TAILQ_REMOVE(&(*root)->root_unuse, task, task_node); | TAILQ_REMOVE(&(*root)->root_unuse, task, task_node); |
| free(task); | free(task); |
| } | } |
| #ifdef HAVE_LIBPTHREAD | #ifdef HAVE_LIBPTHREAD |
| for (i = 0; i < taskMAX; i++) | pthread_mutex_unlock(&(*root)->root_mtx[taskUNUSE]); |
| pthread_mutex_unlock(&(*root)->root_mtx[i]); | |
| #endif | #endif |
| if ((*root)->root_hooks.hook_root.fini) | if ((*root)->root_hooks.hook_root.fini) |