Reimplemented kill/suspend

It seems to work fine except an undefined instruction is generated
from posix userspace occasionally
This commit is contained in:
Bahadir Balban
2009-10-30 21:34:10 +02:00
parent f3c0a38fa9
commit c3c6c10cf7
10 changed files with 114 additions and 157 deletions

View File

@@ -117,7 +117,7 @@ int mutex_lock(struct mutex *mutex)
* undeterministic as to how many retries will result in success.
* We may need to add priority-based locking.
*/
printk("Thread (%d) locking (%p) nlocks: %d\n", current->tid, mutex, current->nlocks);
//printk("Thread (%d) locking (%p) nlocks: %d\n", current->tid, mutex, current->nlocks);
for (;;) {
spin_lock(&mutex->wqh.slock);
if (!__mutex_lock(&mutex->lock)) { /* Could not lock, sleep. */
@@ -132,7 +132,7 @@ int mutex_lock(struct mutex *mutex)
/* Did we wake up normally or get interrupted */
if (current->flags & TASK_INTERRUPTED) {
printk("XXXXXXXXXXXXXXXX (%d) Interrupted\n", current->tid);
//printk("XXXXXXXXXXXXXXXX (%d) Interrupted\n", current->tid);
current->flags &= ~TASK_INTERRUPTED;
return -EINTR;
}
@@ -142,14 +142,14 @@ int mutex_lock(struct mutex *mutex)
}
}
spin_unlock(&mutex->wqh.slock);
printk("Thread (%d) locked (%p) nlocks: %d\n", current->tid, mutex, current->nlocks);
//printk("Thread (%d) locked (%p) nlocks: %d\n", current->tid, mutex, current->nlocks);
return 0;
}
static inline void mutex_unlock_common(struct mutex *mutex, int sync)
{
struct ktcb *c = current; if (c);
printk("Thread (%d) unlocking (%p) nlocks: %d\n", c->tid, mutex, c->nlocks);
//printk("Thread (%d) unlocking (%p) nlocks: %d\n", c->tid, mutex, c->nlocks);
spin_lock(&mutex->wqh.slock);
__mutex_unlock(&mutex->lock);
current->nlocks--;