aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-03-10 20:02:09 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-03-10 20:02:09 +0900
commit965f257e70b2766b41df57c6ead59d422b632062 (patch)
tree808d297ea13de80774fba2443401392e9209bf31
parenteolian: resolve to Eolian_Objects instead of voids (diff)
downloadefl-965f257e70b2766b41df57c6ead59d422b632062.tar.gz
ecore - efl exe/thread - only allow run once ever
-rw-r--r--src/lib/ecore/efl_exe.c5
-rw-r--r--src/lib/ecore/efl_thread.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/ecore/efl_exe.c b/src/lib/ecore/efl_exe.c
index 4ef0aee967..273b97532e 100644
--- a/src/lib/ecore/efl_exe.c
+++ b/src/lib/ecore/efl_exe.c
@@ -61,6 +61,7 @@ struct _Efl_Exe_Data
} fd;
#endif
Eina_Bool exit_called : 1;
+ Eina_Bool run : 1;
};
//////////////////////////////////////////////////////////////////////////
@@ -202,7 +203,7 @@ _exe_exit_eval(Eo *obj, Efl_Exe_Data *pd)
pd->exit_called = EINA_TRUE;
efl_ref(obj);
job = eina_future_then(efl_loop_job(loop), _efl_loop_task_exit, obj);
- efl_future_Eina_FutureXXX_then(loop, job);
+ efl_future_Eina_FutureXXX_then(obj, job);
}
}
@@ -361,6 +362,7 @@ _efl_exe_efl_task_run(Eo *obj EINA_UNUSED, Efl_Exe_Data *pd)
int pipe_exited[2];
int ret;
+ if (pd->run) return EINA_FALSE;
if (pd->pid != -1) return EINA_FALSE;
if (!td) return EINA_FALSE;
@@ -445,6 +447,7 @@ _efl_exe_efl_task_run(Eo *obj EINA_UNUSED, Efl_Exe_Data *pd)
efl_loop_handler_active_set(efl_added,
EFL_LOOP_HANDLER_FLAGS_READ));
_ecore_signal_pid_unlock();
+ pd->run = EINA_TRUE;
return EINA_TRUE;
}
// this code is in the child here, and is temporary setup until we
diff --git a/src/lib/ecore/efl_thread.c b/src/lib/ecore/efl_thread.c
index 857c3c529e..bab5c01717 100644
--- a/src/lib/ecore/efl_thread.c
+++ b/src/lib/ecore/efl_thread.c
@@ -75,6 +75,7 @@ struct _Efl_Thread_Data
Eina_Bool end_sent : 1;
Eina_Bool exit_read : 1;
Eina_Bool exit_called : 1;
+ Eina_Bool run : 1;
};
//////////////////////////////////////////////////////////////////////////
@@ -582,6 +583,7 @@ _efl_thread_efl_task_run(Eo *obj, Efl_Thread_Data *pd)
Efl_Callback_Array_Item_Full *it;
Efl_Task_Data *td = efl_data_scope_get(obj, EFL_TASK_CLASS);
+ if (pd->run) return EINA_FALSE;
if (!td) return EINA_FALSE;
thdat = calloc(1, sizeof(Thread_Data));
if (!thdat) return EINA_FALSE;
@@ -783,6 +785,7 @@ _efl_thread_efl_task_run(Eo *obj, Efl_Thread_Data *pd)
return EINA_FALSE;
}
pd->thdat = thdat;
+ pd->run = EINA_TRUE;
return EINA_TRUE;
}