namespace bthread { extern pthread_mutex_t g_task_control_mutex; } pthread_mutex_t g_worker_start_fn_mutex = PTHREAD_MUTEX_INITIALIZER; */
| 78 | pthread_mutex_t g_worker_start_fn_mutex = PTHREAD_MUTEX_INITIALIZER; |
| 79 | */ |
| 80 | void pthread_worker_start_fn() { |
| 81 | /* |
| 82 | while (pthread_mutex_lock(&g_worker_start_fn_mutex) != 0) { |
| 83 | } |
| 84 | |
| 85 | // Try to avoid deadlock in bthread |
| 86 | int lock_status = pthread_mutex_trylock(&bthread::g_task_control_mutex); |
| 87 | if (lock_status == EBUSY || lock_status == EAGAIN) { |
| 88 | pthread_mutex_unlock(&bthread::g_task_control_mutex); |
| 89 | } |
| 90 | */ |
| 91 | Resource::instance().thread_initialize(); |
| 92 | |
| 93 | // Try to avoid deadlock in bthread |
| 94 | /* |
| 95 | if (lock_status == EBUSY || lock_status == EAGAIN) { |
| 96 | while (pthread_mutex_lock(&bthread::g_task_control_mutex) != 0) { |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | pthread_mutex_unlock(&g_worker_start_fn_mutex); |
| 101 | */ |
| 102 | } |
| 103 | |
| 104 | static void g_change_server_port() { |
| 105 | InferServiceConf conf; |
nothing calls this directly
no test coverage detected