#ifndef BAIDU_PADDLE_SERVING_PREDICTOR_MACROS_H #define BAIDU_PADDLE_SERVING_PREDICTOR_MACROS_H #include "common/inner_common.h" namespace baidu { namespace paddle_serving { namespace predictor { #ifndef CATCH_ANY_AND_RET #define CATCH_ANY_AND_RET(errno) \ catch (...) { \ LOG(FATAL) << "exception catched"; \ return errno; \ } #endif #ifdef USE_PTHREAD #define THREAD_T pthread_t #define THREAD_KEY_T pthread_key_t #define THREAD_MUTEX_T pthread_mutex_t #define THREAD_KEY_CREATE pthread_key_create #define THREAD_SETSPECIFIC pthread_setspecific #define THREAD_GETSPECIFIC pthread_getspecific #define THREAD_CREATE pthread_create #define THREAD_CANCEL pthread_cancel #define THREAD_JOIN pthread_join #define THREAD_KEY_DELETE pthread_key_delete #define THREAD_MUTEX_INIT pthread_mutex_init #define THREAD_MUTEX_LOCK pthread_mutex_lock #define THREAD_MUTEX_UNLOCK pthread_mutex_unlock #define THREAD_MUTEX_DESTROY pthread_mutex_destroy #define THREAD_COND_T pthread_cond_t #define THREAD_COND_INIT pthread_cond_init #define THREAD_COND_SIGNAL pthread_cond_signal #define THREAD_COND_WAIT pthread_cond_wait #define THREAD_COND_DESTROY pthread_cond_destroy #else #define THREAD_T bthread_t #define THREAD_KEY_T bthread_key_t #define THREAD_MUTEX_T bthread_mutex_t #define THREAD_KEY_CREATE bthread_key_create #define THREAD_SETSPECIFIC bthread_setspecific #define THREAD_GETSPECIFIC bthread_getspecific #define THREAD_CREATE bthread_start_background #define THREAD_CANCEL bthread_stop #define THREAD_JOIN bthread_join #define THREAD_KEY_DELETE bthread_key_delete #define THREAD_MUTEX_INIT bthread_mutex_init #define THREAD_MUTEX_LOCK bthread_mutex_lock #define THREAD_MUTEX_UNLOCK bthread_mutex_unlock #define THREAD_MUTEX_DESTROY bthread_mutex_destroy #define THREAD_COND_T bthread_cond_t #define THREAD_COND_INIT bthread_cond_init #define THREAD_COND_SIGNAL bthread_cond_signal #define THREAD_COND_WAIT bthread_cond_wait #define THREAD_COND_DESTROY bthread_cond_destroy #endif } // predictor } // paddle_serving } // baidu #endif