1 /* PR rtl-optimization/16199 */
2 /* Origin: Olaf Klein <oklein@smallo.ruhr.de> */
13 struct apr_proc_mutex_unix_lock_methods_t
{
18 typedef struct apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_lock_methods_t
;
20 extern const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_sysv_methods
;
22 struct apr_proc_mutex_t
{
23 const apr_proc_mutex_unix_lock_methods_t
*inter_meth
;
28 typedef struct apr_proc_mutex_t apr_proc_mutex_t
;
30 extern const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_proc_pthread_methods
;
32 extern const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_fcntl_methods
;
34 static int proc_mutex_choose_method(apr_proc_mutex_t
*new_mutex
, apr_lockmech_e mech
)
38 new_mutex
->inter_meth
= &apr_proc_mutex_unix_fcntl_methods
;
41 return ((20000 + 50000) + 23);
43 case APR_LOCK_SYSVSEM
:
44 new_mutex
->inter_meth
= &apr_proc_mutex_unix_sysv_methods
;
46 case APR_LOCK_POSIXSEM
:
47 return ((20000 + 50000) + 23);
49 case APR_LOCK_PROC_PTHREAD
:
50 new_mutex
->inter_meth
= &apr_proc_mutex_unix_proc_pthread_methods
;
52 case APR_LOCK_DEFAULT
:
53 new_mutex
->inter_meth
= &apr_proc_mutex_unix_proc_pthread_methods
;
56 return ((20000 + 50000) + 23);
61 const char* apr_proc_mutex_defname(void)
63 apr_proc_mutex_t mutex
;
65 if (proc_mutex_choose_method(&mutex
, APR_LOCK_DEFAULT
) != 0) {