Open Gitxiaozhu-oss opened 1 year ago
int rd = 0; \ a_thread = pthread_getspecific(zlog_thread_key); \ if (!a_thread) { \ a_thread = zlog_thread_new(zlog_env_init_version, \ zlog_env_conf->buf_size_min, zlog_env_conf->buf_size_max, \ zlog_env_conf->time_cache_count); \ if (!a_thread) { \ zc_error("zlog_thread_new fail"); \ goto fail_goto; \ } \
\ rd = pthread_setspecific(zlog_thread_key, a_thread); \ if (rd) { \ zlog_thread_del(a_thread); \ zc_error("pthread_setspecific fail, rd[%d]", rd); \ goto fail_goto; \ } \ } \ \ if (a_thread->init_version != zlog_env_init_version) { \ / as mdc is still here, so can not easily del and new / \ rd = zlog_thread_rebuild_msg_buf(a_thread, \ zlog_env_conf->buf_size_min, \ zlog_env_conf->buf_size_max); \ if (rd) { \ zc_error("zlog_thread_resize_msg_buf fail, rd[%d]", rd); \ goto fail_goto; \ } \ \ rd = zlog_thread_rebuild_event(a_thread, zlog_env_conf->time_cache_count); \ if (rd) { \ zc_error("zlog_thread_resize_msg_buf fail, rd[%d]", rd); \ goto fail_goto; \ } \ a_thread->init_version = zlog_env_init_version; \ } \ } while (0)
当进程环境发送变化是调用int zlog_thread_rebuild_event(zlog_thread_t * a_thread, int time_cache_count)函数,当执行zlog_event_del(a_thread->event);程序会发生奔溃,
我这边也遇到了这个问题了。
您好,已收到您的来信
define zlog_fetch_thread(a_thread, fail_goto) do { \
\ rd = pthread_setspecific(zlog_thread_key, a_thread); \ if (rd) { \ zlog_thread_del(a_thread); \ zc_error("pthread_setspecific fail, rd[%d]", rd); \ goto fail_goto; \ } \ } \ \ if (a_thread->init_version != zlog_env_init_version) { \ / as mdc is still here, so can not easily del and new / \ rd = zlog_thread_rebuild_msg_buf(a_thread, \ zlog_env_conf->buf_size_min, \ zlog_env_conf->buf_size_max); \ if (rd) { \ zc_error("zlog_thread_resize_msg_buf fail, rd[%d]", rd); \ goto fail_goto; \ } \ \ rd = zlog_thread_rebuild_event(a_thread, zlog_env_conf->time_cache_count); \ if (rd) { \ zc_error("zlog_thread_resize_msg_buf fail, rd[%d]", rd); \ goto fail_goto; \ } \ a_thread->init_version = zlog_env_init_version; \ } \ } while (0)
当进程环境发送变化是调用int zlog_thread_rebuild_event(zlog_thread_t * a_thread, int time_cache_count)函数,当执行zlog_event_del(a_thread->event);程序会发生奔溃,