apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philip Martin <phi...@codematters.co.uk>
Subject Re: apr_proc_mutex is broken
Date Mon, 18 Nov 2002 16:39:43 GMT
Philip Martin <philip@codematters.co.uk> writes:

> > I just ripped out that code, want to give this another try on your
> > SMP Linux box?
> 
> It still fails.
> 
> As I said, I don't know much about semaphores, but I think the problem
> is something to do with process exit.

The pool cleanup handler

static apr_status_t proc_mutex_sysv_cleanup(void *mutex_)
{
    apr_proc_mutex_t *mutex=mutex_;
    union semun ick;
    
    if (mutex->interproc->filedes != -1) {
        ick.val = 0;
        semctl(mutex->interproc->filedes, 0, IPC_RMID, ick);
    }
    return APR_SUCCESS;
}    

runs when each subprocess in the test exits.  So the first subprocess
to exit will destroy the semaphore, even though the other processes
are using it.

-- 
Philip Martin

Mime
View raw message