lib: thread optimization.

get out of threads if they are canceled.
threads don't need to perform their logic totally.
This commit is contained in:
Hermet Park 2016-08-04 19:25:18 +09:00
parent c5f59c63b8
commit b25d5dffa8
2 changed files with 6 additions and 2 deletions

View File

@ -125,7 +125,7 @@ lexem_tree_free(lexem **root)
}
static void
context_lexem_thread_cb(void *data, Ecore_Thread *thread EINA_UNUSED)
context_lexem_thread_cb(void *data, Ecore_Thread *thread)
{
const int quot_len = QUOT_UTF8_LEN;
@ -163,6 +163,8 @@ context_lexem_thread_cb(void *data, Ecore_Thread *thread EINA_UNUSED)
while (cur && cur <= end)
{
if (ecore_thread_check(thread)) break;
//Check inside quote
if ((cur != end) && (!strncmp(cur, quot, quot_len)))
{

View File

@ -70,7 +70,7 @@ struct parser_s
/*****************************************************************************/
static void
cur_context_thread_blocking(void *data, Ecore_Thread *thread EINA_UNUSED)
cur_context_thread_blocking(void *data, Ecore_Thread *thread)
{
#define PART_SYNTAX_CNT 14
@ -122,6 +122,8 @@ cur_context_thread_blocking(void *data, Ecore_Thread *thread EINA_UNUSED)
while (p && p <= end)
{
if (ecore_thread_check(thread)) break;
//Skip "" range
if (!strncmp(p, QUOT_UTF8, QUOT_UTF8_LEN))
{