Hang detection additions.

This commit is contained in:
Geoffrey Challen
2017-02-09 09:49:03 -05:00
parent 8435ba6436
commit 8af1edae0e
8 changed files with 103 additions and 2 deletions

View File

@@ -36,6 +36,7 @@
*/
#include <cdefs.h>
#include <hangman.h>
/* Inlining support - for making sure an out-of-line copy gets built */
#ifndef SPINLOCK_INLINE
@@ -57,12 +58,18 @@
struct spinlock {
volatile spinlock_data_t splk_lock; /* Memory word where we spin. */
struct cpu *splk_holder; /* CPU holding this lock. */
HANGMAN_LOCKABLE(splk_hangman); /* Deadlock detector hook. */
};
/*
* Initializer for cases where a spinlock needs to be static or global.
*/
#ifdef OPT_HANGMAN
#define SPINLOCK_INITIALIZER { SPINLOCK_DATA_INITIALIZER, NULL, \
HANGMAN_LOCKABLE_INITIALIZER }
#else
#define SPINLOCK_INITIALIZER { SPINLOCK_DATA_INITIALIZER, NULL }
#endif
/*
* Spinlock functions.