From 865ffe9c462555541d33b7f92262653b3de17dd0 Mon Sep 17 00:00:00 2001 From: Vitaliy Cherepanov Date: Mon, 21 Oct 2013 14:10:24 +0400 Subject: [PATCH] [FIX] Stop takes long time merge dynamic-analysis-probe eaaa5255eb87e8a887fdb170a263f5066d1f5689 70343d43a50d1f49fb60607c6167a2f706ccb2c8 Change-Id: I70471af6f4a4c8862087cf4787334f6801b2887f Signed-off-by: Vitaliy Cherepanov --- Makefile | 2 ++ helper/appfw-capi.c | 37 +++++++++++++++++++++++++++++++ helper/appfw-tizen.cpp | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++ helper/libdaprobe.c | 2 +- include/dahelper.h | 2 ++ 5 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 helper/appfw-capi.c create mode 100644 helper/appfw-tizen.cpp diff --git a/Makefile b/Makefile index c546ac3..959a458 100644 --- a/Makefile +++ b/Makefile @@ -42,11 +42,13 @@ COMMON_SRCS = ./helper/libdaprobe.c \ ./probe_file/da_io_stdc.c CAPI_SRCS =$(COMMON_SRCS) \ + ./helper/appfw-capi.c \ ./helper/addr-capi.c \ ./probe_capi/capi_appfw.c \ ./probe_ui/capi_capture.c TIZEN_SRCS = $(COMMON_SRCS) \ + ./helper/appfw-tizen.cpp \ ./helper/addr-tizen.c \ ./probe_memory/libdanew.cpp \ ./probe_tizenapi/tizen_file.cpp \ diff --git a/helper/appfw-capi.c b/helper/appfw-capi.c new file mode 100644 index 0000000..03d2929 --- /dev/null +++ b/helper/appfw-capi.c @@ -0,0 +1,37 @@ +/* + * DA probe + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * + * Jaewon Lim + * Woojin Jung + * Juyoung Kim + * + * This library is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This library is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include + +void application_exit() +{ + app_efl_exit(); +} + diff --git a/helper/appfw-tizen.cpp b/helper/appfw-tizen.cpp new file mode 100644 index 0000000..46405bf --- /dev/null +++ b/helper/appfw-tizen.cpp @@ -0,0 +1,60 @@ +/* + * DA probe + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * + * Jaewon Lim + * Woojin Jung + * Juyoung Kim + * + * This library is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This library is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include +#include +using namespace Tizen::App; + +#define UNKNOWN_USER_EVENT 5873 + +#ifdef __cplusplus +extern "C"{ +#endif + +void application_exit() +{ + App* self = App::GetInstance(); + if(self != NULL) + { + self->Terminate(); + // send unknown user event to main thread + // because this cause that main thread execute terminating routine without block + self->SendUserEvent(UNKNOWN_USER_EVENT, NULL); + } + else + { + app_efl_exit(); + } +} + +#ifdef __cplusplus +} +#endif + diff --git a/helper/libdaprobe.c b/helper/libdaprobe.c index 767b738..d9a5ba6 100755 --- a/helper/libdaprobe.c +++ b/helper/libdaprobe.c @@ -278,7 +278,7 @@ static void* recvThread(void* data) } else if(log.type == MSG_STOP) { - app_efl_exit(); + application_exit(); } else { diff --git a/include/dahelper.h b/include/dahelper.h index 0839821..625be2c 100755 --- a/include/dahelper.h +++ b/include/dahelper.h @@ -213,6 +213,8 @@ int __profil(int mode); //wchar_t* -> char* void WcharToChar(char* pstrDest, const wchar_t* pwstrSrc); +void application_exit(); + // screen capture functions int initialize_screencapture(); int finalize_screencapture(); -- 2.7.4