| 31 | #include "ssl_private.h" |
| 32 | |
| 33 | int ssl_mutex_init(server_rec *s, apr_pool_t *p) |
| 34 | { |
| 35 | SSLModConfigRec *mc = myModConfig(s); |
| 36 | apr_status_t rv; |
| 37 | |
| 38 | /* A mutex is only needed if a session cache is configured, and |
| 39 | * the provider used is not internally multi-process/thread |
| 40 | * safe. */ |
| 41 | if (!mc->sesscache |
| 42 | || (mc->sesscache->flags & AP_SOCACHE_FLAG_NOTMPSAFE) == 0) { |
| 43 | return TRUE; |
| 44 | } |
| 45 | |
| 46 | if (mc->pMutex) { |
| 47 | return TRUE; |
| 48 | } |
| 49 | |
| 50 | if ((rv = ap_global_mutex_create(&mc->pMutex, NULL, SSL_CACHE_MUTEX_TYPE, |
| 51 | NULL, s, s->process->pool, 0)) |
| 52 | != APR_SUCCESS) { |
| 53 | return FALSE; |
| 54 | } |
| 55 | |
| 56 | return TRUE; |
| 57 | } |
| 58 | |
| 59 | int ssl_mutex_reinit(server_rec *s, apr_pool_t *p) |
| 60 | { |
no test coverage detected