Rev 3014 | Rev 3034 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 3014 | Rev 3033 | ||
|---|---|---|---|
| Line 799... | Line 799... | ||
| 799 | interrupts_restore(ipl); |
799 | interrupts_restore(ipl); |
| 800 | return ENOENT; |
800 | return ENOENT; |
| 801 | } |
801 | } |
| 802 | 802 | ||
| 803 | spinlock_lock(&ta->kb_cleanup_lock); |
803 | spinlock_lock(&ta->kb_cleanup_lock); |
| - | 804 | ||
| - | 805 | if (ta->kb_finished != false) { |
|
| - | 806 | spinlock_unlock(&ta->kb_cleanup_lock); |
|
| - | 807 | spinlock_unlock(&tasks_lock); |
|
| - | 808 | interrupts_restore(ipl); |
|
| - | 809 | return EINVAL; |
|
| - | 810 | } |
|
| - | 811 | ||
| 804 | spinlock_unlock(&tasks_lock); |
812 | spinlock_unlock(&tasks_lock); |
| 805 | 813 | ||
| 806 | /* |
814 | /* |
| 807 | * Only ta->kb_cleanup_lock left. Since we checked the value |
815 | * Only ta->kb_cleanup_lock left. Since we checked the value |
| 808 | * of ta->kb_finished, this suffices to ensure the task's exitence. |
816 | * of ta->kb_finished, this suffices to ensure the task's exitence. |
| 809 | * (And that it didn't start kbox cleanup yet). It also ensures |
817 | * (And that it didn't start kbox cleanup yet). It also ensures |
| 810 | * mutual exclusion with other threads running this function. |
818 | * mutual exclusion with other threads running this function. |
| 811 | */ |
819 | */ |
| 812 | 820 | ||
| 813 | if (ta->kb_finished != false) { |
- | |
| 814 | spinlock_unlock(&ta->kb_cleanup_lock); |
- | |
| 815 | interrupts_restore(ipl); |
- | |
| 816 | return EINVAL; |
- | |
| 817 | } |
- | |
| 818 | - | ||
| 819 | /* Connect the newly allocated phone to the kbox */ |
821 | /* Connect the newly allocated phone to the kbox */ |
| 820 | ipc_phone_connect(&TASK->phones[newphid], &ta->kernel_box); |
822 | ipc_phone_connect(&TASK->phones[newphid], &ta->kernel_box); |
| 821 | 823 | ||
| 822 | had_kb_thread = (ta->kb_thread != NULL); |
824 | had_kb_thread = (ta->kb_thread != NULL); |
| 823 | 825 | ||