From e45d0841f9990086919b3041b751284ad4cb7db4 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Wed, 31 Jul 2002 23:00:02 +0000 Subject: [PATCH] STABLE12-linux-note-we-use-interruptible-sleeps-in-non-compliant-manner-20020731 based on discussion with David Howells of RedHat (cherry picked from commit f063c0db2109b3e089c54b4c6dd948bbd72a0ab1) --- src/afs/LINUX/osi_sleep.c | 9 +++++++-- src/rx/LINUX/rx_kmutex.h | 10 +++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/afs/LINUX/osi_sleep.c b/src/afs/LINUX/osi_sleep.c index 0247f45d4..635dd1224 100644 --- a/src/afs/LINUX/osi_sleep.c +++ b/src/afs/LINUX/osi_sleep.c @@ -160,8 +160,13 @@ static void afs_addevent(char *event) /* Release the specified event */ #define relevent(evp) ((evp)->refcount--) -/* afs_osi_Sleep -- waits for an event to be notified. */ - +/* afs_osi_Sleep -- waits for an event to be notified, ignoring signals. + * - NOTE: that on Linux, there are circumstances in which TASK_INTERRUPTIBLE + * can wake up, even if all signals are blocked + * - TODO: handle signals correctly by passing an indication back to the + * caller that the wait has been interrupted and the stack should be cleaned + * up preparatory to signal delivery + */ void afs_osi_Sleep(char *event) { struct afs_event *evp; diff --git a/src/rx/LINUX/rx_kmutex.h b/src/rx/LINUX/rx_kmutex.h index 1ff5b700f..783280f66 100644 --- a/src/rx/LINUX/rx_kmutex.h +++ b/src/rx/LINUX/rx_kmutex.h @@ -97,9 +97,13 @@ static inline void MUTEX_EXIT(afs_kmutex_t *l) #endif #define CV_DESTROY(cv) -/* CV_WAIT and CV_TIMEDWAIT rely on the fact that the Linux kernel has - * a global lock. Thus we can safely drop our locks before calling the - * kernel sleep services. +/* CV_WAIT and CV_TIMEDWAIT sleep until the specified event occurs, or, in the + * case of CV_TIMEDWAIT, until the specified timeout occurs. + * - NOTE: that on Linux, there are circumstances in which TASK_INTERRUPTIBLE + * can wake up, even if all signals are blocked + * - TODO: handle signals correctly by passing an indication back to the + * caller that the wait has been interrupted and the stack should be cleaned + * up preparatory to signal delivery */ static inline int CV_WAIT(afs_kcondvar_t *cv, afs_kmutex_t *l) { -- 2.39.5