added reenter check to lock_dequeue() to avoid unlocking of interrupts

via cause_sig() during an exception.

moved lock check configuration to <minix/sys_config.h> instead of
kernel/config.h, because the 'relocking' field in kinfo depends on it.

other prettification: common locking macro, whether lock timing is on or
not.
This commit is contained in:
Ben Gras
2006-02-10 16:53:51 +00:00
parent c273654032
commit 88ba4b5268
7 changed files with 29 additions and 24 deletions

View File

@@ -51,15 +51,6 @@ _PROTOTYPE( void timer_end, (int cat) );
#define locktimeend(c)
#endif /* DEBUG_TIME_LOCKS */
/* The locking checks counts relocking situation, which are dangerous because
* the inner lock may unlock the outer one.
*/
#if DEBUG_LOCK_CHECK
#define lockcheck if (!(read_cpu_flags() & X86_FLAG_I)) kinfo.relocking++;
#else
#define lockcheck
#endif /* DEBUG_LOCK_CHECK */
/* This check makes sure that the scheduling queues are in a consistent state.
* The check is run when the queues are updated with ready() and unready().
*/
@@ -73,14 +64,9 @@ _PROTOTYPE( void check_runqueues, (char *when) );
*/
#if (DEBUG_TIME_LOCKS || DEBUG_LOCK_CHECK)
# undef lock
# define lock(c, v) do { lockcheck; \
intr_disable(); \
locktimestart(c, v); \
} while(0)
# define lock(c, v) do { reallock(c, v); locktimestart(c, v); } while(0)
# undef unlock
# define unlock(c) do { locktimeend(c); \
intr_enable();\
} while(0)
# define unlock(c) do { locktimeend(c); realunlock(c); } while(0)
#endif
#endif /* DEBUG_H */