| 3279 | } |
| 3280 | |
| 3281 | AP_DECLARE(apr_status_t) ap_thread_main_create(apr_thread_t **thread, |
| 3282 | apr_pool_t *pool) |
| 3283 | { |
| 3284 | apr_status_t rv; |
| 3285 | apr_threadattr_t *attr = NULL; |
| 3286 | |
| 3287 | /* Create an apr_thread_t for the main child thread to set up its Thread |
| 3288 | * Local Storage. Since it's detached and won't apr_thread_exit(), destroy |
| 3289 | * its pool before exiting via a cleanup of the given pool. |
| 3290 | */ |
| 3291 | if ((rv = apr_threadattr_create(&attr, pool)) |
| 3292 | || (rv = apr_threadattr_detach_set(attr, 1)) |
| 3293 | || (rv = ap_thread_current_create(thread, attr, pool))) { |
| 3294 | *thread = NULL; |
| 3295 | return rv; |
| 3296 | } |
| 3297 | |
| 3298 | apr_pool_cleanup_register(pool, *thread, main_thread_cleanup, |
| 3299 | apr_pool_cleanup_null); |
| 3300 | return APR_SUCCESS; |
| 3301 | } |
| 3302 | |
| 3303 | #endif /* APR_HAS_THREADS */ |
| 3304 |
no test coverage detected