X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git;a=blobdiff_plain;f=dali%2Fpublic-api%2Fadaptor-framework%2Fasync-task-manager.h;h=dd3ebc0a55eb342058762bdab2e768db28331114;hp=02021c1aceee26cc12198aef29161fffde95fbea;hb=f3adf97eb3baae9d874309cd2faf6ec5f3d06d40;hpb=f94f8425197e94b9488ff7a9c26ba96b293e4c5e diff --git a/dali/public-api/adaptor-framework/async-task-manager.h b/dali/public-api/adaptor-framework/async-task-manager.h index 02021c1..dd3ebc0 100644 --- a/dali/public-api/adaptor-framework/async-task-manager.h +++ b/dali/public-api/adaptor-framework/async-task-manager.h @@ -2,7 +2,7 @@ #define DALI_ASYNC_TASK_MANAGER_H /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -46,12 +46,20 @@ using AsyncTaskPtr = IntrusivePtr; class DALI_ADAPTOR_API AsyncTask : public RefObject { public: + // The Type of invocation thread + enum class ThreadType + { + MAIN_THREAD, + WORKER_THREAD + }; + /** * Constructor * @SINCE_2_2.3 - * @param[in] callback The callback to up the main thread. The ownership of callback is taken by this class + * @param[in] callback The callback to invoke on task completion, either on the main thread on the worker thread. The ownership of callback is taken by this class. + * @param[in] threadType The thread type of invocation callback. */ - AsyncTask(CallbackBase* callback); + AsyncTask(CallbackBase* callback, ThreadType threadType = AsyncTask::ThreadType::MAIN_THREAD); /** * Get the complated callback @@ -60,6 +68,13 @@ public: CallbackBase* GetCompletedCallback(); /** + * Get the thread of the invocation callback + * @SINCE_2_2.9 + * @return the type of invocation callback. + */ + ThreadType GetCallbackInvocationThread(); + + /** * Destructor. * @SINCE_2_2.3 */ @@ -80,6 +95,7 @@ public: private: std::unique_ptr mCompletedCallback; + ThreadType mThreadType; // Undefined AsyncTask(const AsyncTask& task) = delete;