修复可能会起多个fd管理线程的bug
This commit is contained in:
@@ -759,11 +759,13 @@ int hos_open_fd(hos_client_handle handle, const char *bucket, const char *object
|
|||||||
NULL,/*cache*/ handle->cache_count, 0,/*position*/ 0,/*recive_cnt*/(long)handle->cache_size,/*cache_rest*/ HOS_FD_REGISTER,/*fd_status*/ 0,/*overtime*/ handle->timeout,};
|
NULL,/*cache*/ handle->cache_count, 0,/*position*/ 0,/*recive_cnt*/(long)handle->cache_size,/*cache_rest*/ HOS_FD_REGISTER,/*fd_status*/ 0,/*overtime*/ handle->timeout,};
|
||||||
add_hos_info(&hash_hos_info[thread_id], &info);
|
add_hos_info(&hash_hos_info[thread_id], &info);
|
||||||
#if 1
|
#if 1
|
||||||
if (handle->fd_thread == 0)
|
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> locker(m_client_lock);
|
std::lock_guard<std::mutex> locker(m_client_lock);
|
||||||
handle->fd_thread_status = 0;
|
if (handle->fd_thread == 0)
|
||||||
pthread_create(&handle->fd_thread, NULL, hos_fd_manage, handle);
|
{
|
||||||
|
handle->fd_thread_status = 0;
|
||||||
|
pthread_create(&handle->fd_thread, NULL, hos_fd_manage, handle);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return fd;
|
return fd;
|
||||||
|
|||||||
Reference in New Issue
Block a user