mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-09 22:23:27 +00:00
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:
parent
709548701a
commit
1eb11f249e
2 changed files with 18 additions and 0 deletions
|
@ -365,6 +365,8 @@ public:
|
||||||
*/
|
*/
|
||||||
static Result init(CanvasEngine engine) noexcept;
|
static Result init(CanvasEngine engine) noexcept;
|
||||||
static Result term(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);
|
_TVG_DISABLE_CTOR(Initializer);
|
||||||
};
|
};
|
||||||
|
|
|
@ -38,6 +38,8 @@
|
||||||
/* Internal Class Implementation */
|
/* Internal Class Implementation */
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
|
||||||
|
static uint32_t threadCnt = 0;
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
/* External Class Implementation */
|
/* External Class Implementation */
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
@ -93,4 +95,18 @@ Result Initializer::term(CanvasEngine engine) noexcept
|
||||||
return Result::Success;
|
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_ */
|
#endif /* _TVG_INITIALIZER_CPP_ */
|
||||||
|
|
Loading…
Add table
Reference in a new issue