summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzhengchao <[email protected]>2018-11-27 12:57:22 +0800
committerzhengchao <[email protected]>2018-11-27 15:13:10 +0800
commit4afb26f437a510d9a7a52f7ecec539bfd3385b3d (patch)
tree00b3b467f63c4f636da8162a30fca66e3d20eb31
parent1aac5dfe652df22aba3c167304b290744cd2fc45 (diff)
不创建线程时,不应调用pthread_join。
-rw-r--r--src/MESA_field_stat.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/MESA_field_stat.cpp b/src/MESA_field_stat.cpp
index 2e101de..ab98dd4 100644
--- a/src/MESA_field_stat.cpp
+++ b/src/MESA_field_stat.cpp
@@ -608,8 +608,11 @@ void FS_stop(screen_stat_handle_t* handle)
int i=0;
void * ret=NULL;
struct FS_space_t* _handle=*(struct FS_space_t**)handle;
- _handle->create_thread=0;
- pthread_join(_handle->cfg_mon_t, &ret);
+ if(_handle->create_thread==1 && _handle->cfg_mon_t!=0)
+ {
+ _handle->create_thread=0;
+ pthread_join(_handle->cfg_mon_t, &ret);
+ }
struct display_manifest_t * p=NULL;
for(i=0;i<_handle->display_cnt;i++)
{