imay commented on a change in pull request #1942: Fixed: add mutex for cpu_info init() URL: https://github.com/apache/incubator-doris/pull/1942#discussion_r333038878
########## File path: be/src/util/cpu_info.cpp ########## @@ -81,6 +81,7 @@ int CpuInfo::max_num_numa_nodes_; unique_ptr<int[]> CpuInfo::core_to_numa_node_; vector<vector<int>> CpuInfo::numa_node_to_cores_; vector<int> CpuInfo::numa_node_core_idx_; +pthread_mutex_t CpuInfo::init_mutex_; Review comment: 1. we don't need this lock, because CpuInfo is only initialized in main function. 2. even if we need a lock, std::mutex is preferred. 3. you don't call pthread_mutex_init() to initialize this variable, it will lead process crash. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
