Do not use bitfield for thread sensitive values 37/317937/2
authorEunki, Hong <eunkiki.hong@samsung.com>
Fri, 10 Jan 2025 04:20:37 +0000 (13:20 +0900)
committerEunki Hong <eunkiki.hong@samsung.com>
Tue, 14 Jan 2025 04:40:35 +0000 (04:40 +0000)
commit104a9ebf52e07fa4a3353c78b98f7bd2ac8d6f46
treefac5ec5247183b8f401adbe7823ae03751eca9ef
parentf4c7ab096eb2ca03edd063d758f8c215afc2c92b
Do not use bitfield for thread sensitive values

Their was some mysterious bugs occured on real world application.

  if(needRasterize)
  {
    mNeedToSleep = false;
  }

  DALI_TRACE_END_WITH_MESSAGE_GENERATOR(gTraceFilter, "VECTOR_ANIMATION_THREAD_COMPLETED_TASK", [&](std::ostringstream& oss) {
    oss << "[w:" << mWorkingTasks.size() << ",c:" << mCompletedTasks.size() << ",r?" << needRasterize << ",s?" << mNeedToSleep << "]";
  });

For like this code, we got r?1,s?1 logs.
mean, mNeedToSleep become true even if needRasterize is true.

    mForceRenderOnce = true;

    DALI_LOG_DEBUG_INFO("VectorAnimationThread::mEventTrigger Triggered!\n");

The mForceRenderOnce value didn't depend on mConditionalWait, the race condition
might occured.

To avoid this kind of issue, let we seperate memory area for each values
if they are thread sensitive.

Change-Id: Ie45d0c273ad318c46baf72a1c8462792a35460ad
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
dali-toolkit/internal/visuals/animated-vector-image/vector-animation-thread.h