httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manoj Kasichainula <man...@raleigh.ibm.com>
Subject Re: cvs commit: apache-2.0/src/lib/apr/time/unix time.c
Date Wed, 06 Oct 1999 20:26:45 GMT
On Wed, Oct 06, 1999 at 06:48:52AM -0000, rbb@hyperreal.org wrote:
>   +#ifndef _POSIX_THREAD_SAFE_FUNCTIONS
>   +#define SAFETY_LOCK(func_name, cnt, name_str) \
>   +    { \
>   +    struct lock_t *funclock = lock_##func_name; \
>   +    if (funclock == NULL) \
>   +        if (ap_create_lock(cnt, APR_MUTEX, APR_LOCKALL, name_str, &funclock) !=
APR_SUCCESS) \
>   +            return APR_NOTTHREADSAFE; \
>   +    if (ap_lock(funclock) != APR_SUCCESS) \
>   +        return APR_NOTTHREADSAFE; \
>   +    }

According to Single Unix, any of asctime, ctime, getdate,
gettimeofday, and gmtime can overwrite each other's values. So a
per-function lock isn't enough in this case.

Also, can we assume that if there are nonstandard _r functions (i.e.
_POSIX_THREAD_SAFE_FUNCTIONS is not defined) that they will behave the
same as pthreads/SUS dictate? If not, then we should check for
_POSIX_THREAD_SAFE_FUNCTIONS instead of letting autoconf check for
each _r function individually.

-- 
Manoj Kasichainula - manojk@raleigh.ibm.com
IBM, Apache Development

Mime
View raw message