static uint32_t ms_set_thread_cpu_affinity(uint32_t cpu);
static int ms_setup_thread(ms_thread_ctx_t *thread_ctx);
static void *ms_worker_libevent(void *arg);
static uint32_t ms_set_thread_cpu_affinity(uint32_t cpu);
static int ms_setup_thread(ms_thread_ctx_t *thread_ctx);
static void *ms_worker_libevent(void *arg);
if (ms_thread->base == NULL) {
if (atomic_add_32_nv(&cnt, 1) == 0) {
fprintf(stderr, "Can't allocate event base.\n");
if (ms_thread->base == NULL) {
if (atomic_add_32_nv(&cnt, 1) == 0) {
fprintf(stderr, "Can't allocate event base.\n");
/* only output this error once */
if (atomic_add_32_nv(&cnt, 1) == 0) {
fprintf(stderr, "Initializing connection failed.\n");
/* only output this error once */
if (atomic_add_32_nv(&cnt, 1) == 0) {
fprintf(stderr, "Initializing connection failed.\n");
ms_thread = pthread_getspecific(ms_thread_key);
event_base_loop(ms_thread->base, 0);
ms_thread = pthread_getspecific(ms_thread_key);
event_base_loop(ms_thread->base, 0);
* @param func, the callback function
* @param arg, the argument to pass to the callback function
*/
* @param func, the callback function
* @param arg, the argument to pass to the callback function
*/
- if ((ret = pthread_create(&thread, &attr, func, arg)) != 0) {
+ if ((ret = pthread_create(&arg->pth_id, &attr, func, arg))) {
}
/* Create threads after we've done all the epoll setup. */
for (uint32_t i = 0; i < ms_setting.nthreads; i++) {
}
/* Create threads after we've done all the epoll setup. */
for (uint32_t i = 0; i < ms_setting.nthreads; i++) {