Changes to use deadlock detection.

This commit is contained in:
Geoffrey Challen
2017-02-09 09:52:18 -05:00
parent 9986e07810
commit a0ecc1e7e5
4 changed files with 204 additions and 0 deletions

View File

@@ -154,6 +154,8 @@ lock_create(const char *name)
return NULL;
}
HANGMAN_LOCKABLEINIT(&lock->lk_hangman, lock->lk_name);
// add stuff here as needed
return lock;
@@ -173,14 +175,23 @@ lock_destroy(struct lock *lock)
void
lock_acquire(struct lock *lock)
{
/* Call this (atomically) before waiting for a lock */
//HANGMAN_WAIT(&curthread->t_hangman, &lock->lk_hangman);
// Write this
(void)lock; // suppress warning until code gets written
/* Call this (atomically) once the lock is acquired */
//HANGMAN_ACQUIRE(&curthread->t_hangman, &lock->lk_hangman);
}
void
lock_release(struct lock *lock)
{
/* Call this (atomically) when the lock is released */
//HANGMAN_RELEASE(&curthread->t_hangman, &lock->lk_hangman);
// Write this
(void)lock; // suppress warning until code gets written