common initializer: introduce thread count api.

this interface controls the number of threads working behind.

default is 0 == only syncrhonous.

Change-Id: I8404f33359e6213acc5e578061568fede50cd9a6
This commit is contained in:
Hermet Park 2020-08-14 18:51:38 +09:00
parent 709548701a
commit 1eb11f249e
2 changed files with 18 additions and 0 deletions

View file

@ -365,6 +365,8 @@ public:
*/
static Result init(CanvasEngine engine) noexcept;
static Result term(CanvasEngine engine) noexcept;
static Result threads(uint32_t cnt) noexcept;
static uint32_t threads() noexcept;
_TVG_DISABLE_CTOR(Initializer);
};

View file

@ -38,6 +38,8 @@
/* Internal Class Implementation */
/************************************************************************/
static uint32_t threadCnt = 0;
/************************************************************************/
/* External Class Implementation */
/************************************************************************/
@ -93,4 +95,18 @@ Result Initializer::term(CanvasEngine engine) noexcept
return Result::Success;
}
Result Initializer::threads(uint32_t cnt) noexcept
{
threadCnt = cnt;
return Result::Success;
}
uint32_t Initializer::threads() noexcept
{
return threadCnt;
}
#endif /* _TVG_INITIALIZER_CPP_ */