From c8c5343c0ee8fb83ece66cc547b716a011aed14c Mon Sep 17 00:00:00 2001 From: David Leonard Date: Mon, 21 Dec 1998 07:42:55 +0000 Subject: use md spinlock; signal statistics --- lib/libc_r/uthread/uthread_sig.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib/libc_r') diff --git a/lib/libc_r/uthread/uthread_sig.c b/lib/libc_r/uthread/uthread_sig.c index 3e55d6505a3..85aca6cbe57 100644 --- a/lib/libc_r/uthread/uthread_sig.c +++ b/lib/libc_r/uthread/uthread_sig.c @@ -42,6 +42,8 @@ static int volatile yield_on_unlock_thread = 0; static spinlock_t thread_link_list_lock = _SPINLOCK_INITIALIZER; +int _thread_sig_statistics[NSIG]; + /* Lock the thread list: */ void _lock_thread_list() @@ -77,6 +79,11 @@ _thread_sig_handler(int sig, int code, struct sigcontext * scp) int i; pthread_t pthread; + /* + * Record the number of times this signal has been received + */ + _thread_sig_statistics[sig]++; + /* * Check if the pthread kernel has unblocked signals (or is about to) * and was on its way into a _select when the current @@ -106,7 +113,7 @@ _thread_sig_handler(int sig, int code, struct sigcontext * scp) * unfortunate time which one of the threads is * modifying the thread list: */ - if (thread_link_list_lock.access_lock) + if (_atomic_is_locked(&thread_link_list_lock.access_lock)) /* * Set a flag so that the thread that has * the lock yields when it unlocks the -- cgit v1.2.3