| 494 | } |
| 495 | |
| 496 | static void xh_core_init_once() |
| 497 | { |
| 498 | if(xh_core_inited) return; |
| 499 | |
| 500 | pthread_mutex_lock(&xh_core_mutex); |
| 501 | |
| 502 | if(xh_core_inited) goto end; |
| 503 | |
| 504 | xh_core_inited = 1; |
| 505 | |
| 506 | //dump debug info |
| 507 | XH_LOG_INFO("%s\n", xh_version_str_full()); |
| 508 | #if XH_CORE_DEBUG |
| 509 | xh_core_hook_info_t *hi; |
| 510 | TAILQ_FOREACH(hi, &xh_core_hook_info, link) |
| 511 | XH_LOG_INFO(" hook: %s @ %s, (%p, %p)\n", hi->symbol, hi->pathname_regex_str, |
| 512 | hi->new_func, hi->old_func); |
| 513 | xh_core_ignore_info_t *ii; |
| 514 | TAILQ_FOREACH(ii, &xh_core_ignore_info, link) |
| 515 | XH_LOG_INFO(" ignore: %s @ %s\n", ii->symbol ? ii->symbol : "ALL ", |
| 516 | ii->pathname_regex_str); |
| 517 | #endif |
| 518 | |
| 519 | //register signal handler |
| 520 | if(0 != xh_core_add_sigsegv_handler()) goto end; |
| 521 | |
| 522 | //OK |
| 523 | xh_core_init_ok = 1; |
| 524 | |
| 525 | end: |
| 526 | pthread_mutex_unlock(&xh_core_mutex); |
| 527 | } |
| 528 | |
| 529 | static void xh_core_init_async_once() |
| 530 | { |
no test coverage detected