But what about SockAccept and SockRelease, they do not use lock mutex
but update firstClosePtr.

I have small communication driver so those errors may not be related to
firstClosePtr.


Jim Davidson wrote:

Hi,


Seems like firstClosePtr at least is protected -- there's an
informatively named Ns_Mutex defined:

static Ns_Mutex lock; /* Lock around close list and shutdown flag. */

and then in NsSockClose:

void
NsSockClose(Sock *sockPtr, int keep)
{
  ...
    Ns_MutexLock(&lock);
    if (firstClosePtr == NULL) {
         trigger = 1;
    }
    sockPtr->keep = keep;
    sockPtr->nextPtr = firstClosePtr;
    firstClosePtr = sockPtr;
    Ns_MutexUnlock(&lock);
    if (trigger) {
         SockTrigger();
    }
}


and in DriverThread:


static void
DriverThread(void *ignored)
{
 ...
  /*
  * Check for shutdown and get the list of any closing or
  * keepalive sockets.
  */

 Ns_MutexLock(&lock);
 sockPtr = firstClosePtr;
 firstClosePtr = NULL;
 stopping = shutdownPending;
 Ns_MutexUnlock(&lock);


I've debugged a similar problem before -- turned out to be a misbehaved module closing sockets twice or something. Are you getting these bad file errors with simple nsd/nssock only configs?

-Jim



--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of 
your email blank.

Reply via email to