build: fix race-condition.

Use a global variable to keep track of builds. Both
edi_exe_notify/handle could and should be done
better. For now this stops an issue.
This commit is contained in:
Al Poole 2017-09-19 20:16:32 +01:00
parent bcd9c85741
commit e528a3c8bc
1 changed files with 9 additions and 0 deletions

View File

@ -16,6 +16,8 @@ typedef struct _Edi_Exe_Args {
Ecore_Event_Handler *handler;
} Edi_Exe_Args;
static Eina_Bool _edi_exe_in_progress = EINA_FALSE;
static Eina_Bool
_edi_exe_notify_data_cb(void *data, int type EINA_UNUSED, void *event EINA_UNUSED)
{
@ -81,6 +83,8 @@ _edi_exe_event_done_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event
free(args);
_edi_exe_in_progress = EINA_FALSE;
return ECORE_CALLBACK_DONE;
}
@ -89,6 +93,11 @@ edi_exe_notify(const char *name, const char *command)
{
Edi_Exe_Args *args;
if (_edi_exe_in_progress)
return;
_edi_exe_in_progress = EINA_TRUE;
ecore_exe_pipe_run(command,
ECORE_EXE_PIPE_READ_LINE_BUFFERED | ECORE_EXE_PIPE_READ |
ECORE_EXE_PIPE_ERROR_LINE_BUFFERED | ECORE_EXE_PIPE_ERROR |