If the caller thread ID is equal to the caller process ID,
the function releases the handle immediately. If it's not,
the function uses glib idler to avoid thread safe issues.
Change-Id: Id8272fb15be06459bab153932c4e1c0a9115fbf6
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
#include "aul/api/aul_app_event.h"
#include <glib.h>
+#include <sys/types.h>
+#include <unistd.h>
#include <string>
#include <utility>
}
auto* handle = static_cast<AppEventStub*>(app_event);
- handle->Dispose();
+ if (getpid() == gettid())
+ delete handle;
+ else
+ handle->Dispose();
+
return AUL_R_OK;
}