thorvg/src
Hermet Park 6dd414ee3b sw_engine: fix invalid data sharing at multi-threading.
We have encountered that multi-threading usage that user creates,
multiple canvases owned by multiple user threads.

Current sw_engine memory pool has been considered only for multi-threads,
spawned by tvg task scheduler.

In this case it's safe but when user threads introduced, it can occur race-condition.

Thus, Here is a renewal policy that non-threading tvg(initialized threads with zero),
takes care of multiple user threads bu changing its policy,
each of canvases should have individual memory pool to guarantee mutual-exclusion.

@API additions

enum MempoolPolicy
{
    Default = 0, ///< Default behavior that ThorVG is designed to.
    Shareable,   ///< Memory Pool is shared among the SwCanvases.
    Individual   ///< Allocate designated memory pool that is only used by current instance.
};

Result SwCanvas::mempool(MempoolPolicy policy) noexcept;

All in all, if user calls multiple threads, set memory pool policy to Individual.
2021-05-12 10:59:50 +09:00
..
bin updated copyright 2021-03-23 14:31:58 +09:00
bindings capi: added check against null pointer before dereferencing 2021-05-11 12:09:23 +02:00
examples examples: fix wrong data size conversion. 2021-05-01 12:56:49 +09:00
lib sw_engine: fix invalid data sharing at multi-threading. 2021-05-12 10:59:50 +09:00
loaders loader SvgLoader: Fix memory leak 2021-05-03 16:29:30 +09:00
wasm updated copyright 2021-03-23 14:31:58 +09:00
meson.build meson: revise png loader meson script. 2021-04-02 12:49:18 +09:00