projects
/
platform
/
core
/
uifw
/
dali-adaptor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add GetCallbackInvocationThread() for AsyncTaskMananager
[platform/core/uifw/dali-adaptor.git]
/
dali
/
internal
/
system
/
common
/
async-task-manager-impl.cpp
diff --git
a/dali/internal/system/common/async-task-manager-impl.cpp
b/dali/internal/system/common/async-task-manager-impl.cpp
index
828d98e
..
a1ed1ce
100644
(file)
--- a/
dali/internal/system/common/async-task-manager-impl.cpp
+++ b/
dali/internal/system/common/async-task-manager-impl.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 202
2
Samsung Electronics Co., Ltd.
+ * Copyright (c) 202
3
Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-292,24
+292,36
@@
AsyncTaskPtr AsyncTaskManager::PopNextCompletedTask()
void AsyncTaskManager::CompleteTask(AsyncTaskPtr task)
{
// Lock while adding task to the queue
void AsyncTaskManager::CompleteTask(AsyncTaskPtr task)
{
// Lock while adding task to the queue
- Mutex::ScopedLock lock(mMutex);
- for(auto iter = mRunningTasks.begin(), endIter = mRunningTasks.end(); iter != endIter; ++iter)
{
{
- if((*iter).first == task)
+ Mutex::ScopedLock lock(mMutex);
+ for(auto iter = mRunningTasks.begin(), endIter = mRunningTasks.end(); iter != endIter; ++iter)
{
{
- if(
!(*iter).second
)
+ if(
(*iter).first == task
)
{
{
- mCompletedTasks.push_back(task);
- }
+ if(!(*iter).second)
+ {
+ if(task->GetCallbackInvocationThread() == AsyncTask::ThreadType::MAIN_THREAD)
+ {
+ mCompletedTasks.push_back(task);
+ }
+ }
- // Delete this task in running queue
- mRunningTasks.erase(iter);
- break;
+ // Delete this task in running queue
+ mRunningTasks.erase(iter);
+ break;
+ }
}
}
// wake up the main thread
}
}
// wake up the main thread
- mTrigger->Trigger();
+ if(task->GetCallbackInvocationThread() == AsyncTask::ThreadType::MAIN_THREAD)
+ {
+ mTrigger->Trigger();
+ }
+ else
+ {
+ CallbackBase::Execute(*(task->GetCompletedCallback()), task);
+ }
}
void AsyncTaskManager::UnregisterProcessor()
}
void AsyncTaskManager::UnregisterProcessor()