|
|
| version 1.12, 2012/08/08 08:25:39 | version 1.13.2.1, 2012/08/21 11:07:16 |
|---|---|
| Line 207 sched_hook_cancel(void *task, void *arg __unused) | Line 207 sched_hook_cancel(void *task, void *arg __unused) |
| #endif | #endif |
| break; | break; |
| #endif | #endif |
| case taskTHREAD: | |
| #ifdef HAVE_LIBPTHREAD | |
| pthread_cancel((pthread_t) TASK_VAL(t)); | |
| #endif | |
| default: | default: |
| return NULL; | return NULL; |
| } | } |
| Line 958 sched_hook_fetch(void *root, void *arg __unused) | Line 962 sched_hook_fetch(void *root, void *arg __unused) |
| } | } |
| /* put regular task priority task to ready queue, | /* put regular task priority task to ready queue, |
| if there is no ready task or reach max missing hit events */ | if there is no ready task or reach max missing hit for regular task */ |
| if ((task = TAILQ_FIRST(&r->root_task))) { | if ((task = TAILQ_FIRST(&r->root_task))) { |
| if (!TAILQ_FIRST(&r->root_ready) || r->root_task_miss > r->root_miss) { | if (!TAILQ_FIRST(&r->root_ready) || r->root_miss >= TASK_VAL(task)) { |
| r->root_task_miss ^= r->root_task_miss; | r->root_miss ^= r->root_miss; |
| #ifdef HAVE_LIBPTHREAD | #ifdef HAVE_LIBPTHREAD |
| pthread_mutex_lock(&r->root_mtx[taskTASK]); | pthread_mutex_lock(&r->root_mtx[taskTASK]); |
| Line 979 sched_hook_fetch(void *root, void *arg __unused) | Line 983 sched_hook_fetch(void *root, void *arg __unused) |
| pthread_mutex_unlock(&r->root_mtx[taskREADY]); | pthread_mutex_unlock(&r->root_mtx[taskREADY]); |
| #endif | #endif |
| } else | } else |
| r->root_task_miss++; | r->root_miss++; |
| } else | } else |
| r->root_task_miss ^= r->root_task_miss; | r->root_miss ^= r->root_miss; |
| /* OK, lets get ready task !!! */ | /* OK, lets get ready task !!! */ |
| task = TAILQ_FIRST(&r->root_ready); | task = TAILQ_FIRST(&r->root_ready); |