From: Hwankyu Jhun Date: Tue, 17 Jan 2023 06:41:41 +0000 (+0000) Subject: Modify PushAndWaitAndPop test case X-Git-Tag: accepted/tizen/unified/20230118.043051~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=11d2091c58f004c6badbd24c011af234634b2e6c;p=platform%2Fcore%2Fbase%2Fbundle.git Modify PushAndWaitAndPop test case The previous implementation has a timing issue. This patch is to fix the issue. The main thread calls WaitAndPop() method and the thread calls Push() method. Change-Id: Id4b19b6fee1c31f2ebd8bed16dbc782161c3c8e5 Signed-off-by: Hwankyu Jhun --- diff --git a/tests/tizen-shared-queue_unittests/test_shared_queue.cc b/tests/tizen-shared-queue_unittests/test_shared_queue.cc index d41ca40..e12e28c 100644 --- a/tests/tizen-shared-queue_unittests/test_shared_queue.cc +++ b/tests/tizen-shared-queue_unittests/test_shared_queue.cc @@ -41,12 +41,10 @@ class Job { TEST(SharedQueueTest, PushAndWaitAndPop) { tizen_base::SharedQueue queue; std::thread thread([&] { - auto job = queue.WaitAndPop(); + Job job; job.Do(); queue.Push(std::move(job)); }); - queue.Push(Job()); - usleep(100); auto job = queue.WaitAndPop(); thread.join();