相关代码为:
_ret = pthread_create(&g_clients_db.handle_thread_id, NULL, handle_thread,NULL); if(_ret != 0){ printf("[create_handle_thread]:fail pthread_create:handle_thread()\n"); return -40; }
_ret = pthread_join(g_clients_db.handle_thread_id,NULL); if(_ret != 0){ printf("[join_handle_thread]:fail pthread_create:handle_thread()\n"); return -4; }
_ret = pthread_create(&g_clients_db.handle_thread_id, NULL, handle_thread,NULL);
pthread_create(&g_clients_db.handle_thread_id, NULL, handle_thread,NULL);
#if defined(WITH_THREADING) && !defined(WITH_BROKER) # include <pthread.h> #else # include "dummypthread.h" #endif
#ifndef _DUMMYPTHREAD_H_ #define _DUMMYPTHREAD_H_ #define pthread_create(A, B, C, D) #define pthread_join(A, B) #define pthread_cancel(A) #define pthread_mutex_init(A, B) #define pthread_mutex_destroy(A) #define pthread_mutex_lock(A) #define pthread_mutex_unlock(A) #endif