MCPcopy Create free account
hub / github.com/PaddlePaddle/Serving / pthread_worker_start_fn

Function pthread_worker_start_fn

core/predictor/src/pdserving.cpp:80–102  ·  view source on GitHub ↗

namespace bthread { extern pthread_mutex_t g_task_control_mutex; } pthread_mutex_t g_worker_start_fn_mutex = PTHREAD_MUTEX_INITIALIZER; */

Source from the content-addressed store, hash-verified

78pthread_mutex_t g_worker_start_fn_mutex = PTHREAD_MUTEX_INITIALIZER;
79*/
80void 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
104static void g_change_server_port() {
105 InferServiceConf conf;

Callers

nothing calls this directly

Calls 1

thread_initializeMethod · 0.45

Tested by

no test coverage detected