diff options
| author | 彭宣正 <[email protected]> | 2021-07-12 11:09:53 +0800 |
|---|---|---|
| committer | 彭宣正 <[email protected]> | 2021-07-21 11:10:06 +0000 |
| commit | d775b9d7e4d817e64ef3c959cd9b483474f1b880 (patch) | |
| tree | 19771888f4edb0937e8a40b20f638093f74797d3 /src | |
| parent | a3cbaeb0cc0af74b909aa317882fdfc04592e5ef (diff) | |
🐞 fix(src): 解决hos init失败可能无法退出的问题,TSG-7163v2.0.4
Diffstat (limited to 'src')
| -rw-r--r-- | src/hos_client.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/hos_client.cpp b/src/hos_client.cpp index a589b26c..fb523b8c 100644 --- a/src/hos_client.cpp +++ b/src/hos_client.cpp @@ -46,6 +46,7 @@ extern "C" struct hos_instance_s g_hos_instance; hos_client_handle_t g_hos_handle;//一个进程只允许有一个g_hos_handle static std::mutex m_client_lock; +static std::mutex m_instance_lock; static std::mutex m_delete_lock; hos_fd_context_t **g_fd_context; size_t *g_fd_info; //fd 实际从1开始,每个线程有独立的fd @@ -1055,7 +1056,7 @@ int hos_close_fd(size_t fd, size_t thread_id) int hos_shutdown_instance() { - std::lock_guard<std::mutex> locker(m_client_lock); + std::lock_guard<std::mutex> locker(m_instance_lock); size_t i = 0; hos_config_t *hos_conf = &g_hos_handle.hos_config; hos_func_thread_t *hos_func = &g_hos_handle.hos_func; |
