@@ -53,7 +53,7 @@ struct AsyncLoaderTest
5353 explicit AsyncLoaderTest (std::vector<Initializer> initializers)
5454 : loader(getPoolInitializers(initializers), /* log_failures = */ false, /* log_progress = */ false, /* log_events = */ false)
5555 {
56- loader.stop (); // All tests call `start ()` manually to better control ordering
56+ loader.pause (); // All tests call `unpause ()` manually to better control ordering
5757 }
5858
5959 explicit AsyncLoaderTest (size_t max_threads = 1 )
@@ -181,7 +181,7 @@ TEST(AsyncLoader, Smoke)
181181
182182 std::thread waiter_thread ([&t, job5] { t.loader .wait (job5); });
183183
184- t.loader .start ();
184+ t.loader .unpause ();
185185
186186 t.loader .wait (job3);
187187 t.loader .wait ();
@@ -196,7 +196,7 @@ TEST(AsyncLoader, Smoke)
196196 ASSERT_EQ (jobs_done, 5 );
197197 ASSERT_EQ (low_priority_jobs_done, 1 );
198198
199- t.loader .stop ();
199+ t.loader .pause ();
200200}
201201
202202TEST (AsyncLoader, CycleDetection)
@@ -348,7 +348,7 @@ TEST(AsyncLoader, CancelPendingDependency)
348348TEST (AsyncLoader, CancelExecutingJob)
349349{
350350 AsyncLoaderTest t;
351- t.loader .start ();
351+ t.loader .unpause ();
352352
353353 std::barrier sync (2 );
354354
@@ -380,7 +380,7 @@ TEST(AsyncLoader, CancelExecutingJob)
380380TEST (AsyncLoader, CancelExecutingTask)
381381{
382382 AsyncLoaderTest t (16 );
383- t.loader .start ();
383+ t.loader .unpause ();
384384 std::barrier sync (2 );
385385
386386 auto blocker_job_func = [&] (AsyncLoader &, const LoadJobPtr &)
@@ -436,7 +436,7 @@ TEST(AsyncLoader, CancelExecutingTask)
436436TEST (AsyncLoader, JobFailure)
437437{
438438 AsyncLoaderTest t;
439- t.loader .start ();
439+ t.loader .unpause ();
440440
441441 std::string error_message = " test job failure" ;
442442
@@ -466,7 +466,7 @@ TEST(AsyncLoader, JobFailure)
466466TEST (AsyncLoader, ScheduleJobWithFailedDependencies)
467467{
468468 AsyncLoaderTest t;
469- t.loader .start ();
469+ t.loader .unpause ();
470470
471471 std::string_view error_message = " test job failure" ;
472472
@@ -522,7 +522,7 @@ TEST(AsyncLoader, ScheduleJobWithCanceledDependencies)
522522 auto canceled_task = t.schedule ({ canceled_job });
523523 canceled_task->remove ();
524524
525- t.loader .start ();
525+ t.loader .unpause ();
526526
527527 auto job_func = [&] (AsyncLoader &, const LoadJobPtr &) {};
528528 auto job1 = makeLoadJob ({ canceled_job }, " job1" , job_func);
@@ -559,7 +559,7 @@ TEST(AsyncLoader, IgnoreDependencyFailure)
559559{
560560 AsyncLoaderTest t;
561561 std::atomic<bool > success{false };
562- t.loader .start ();
562+ t.loader .unpause ();
563563
564564 std::string_view error_message = " test job failure" ;
565565
@@ -588,7 +588,7 @@ TEST(AsyncLoader, CustomDependencyFailure)
588588 int error_count = 0 ;
589589 std::atomic<size_t > good_count{0 };
590590 std::barrier canceled_sync (4 );
591- t.loader .start ();
591+ t.loader .unpause ();
592592
593593 std::string_view error_message = " test job failure" ;
594594
@@ -675,7 +675,7 @@ TEST(AsyncLoader, WaitersLimit)
675675 };
676676
677677 std::barrier sync (2 );
678- t.loader .start ();
678+ t.loader .unpause ();
679679
680680 auto job_func = [&] (AsyncLoader &, const LoadJobPtr &) {
681681 sync.arrive_and_wait (); // (A)
@@ -723,7 +723,7 @@ TEST(AsyncLoader, WaitersLimit)
723723TEST (AsyncLoader, TestConcurrency)
724724{
725725 AsyncLoaderTest t (10 );
726- t.loader .start ();
726+ t.loader .unpause ();
727727
728728 for (int concurrency = 1 ; concurrency <= 10 ; concurrency++)
729729 {
@@ -750,7 +750,7 @@ TEST(AsyncLoader, TestConcurrency)
750750TEST (AsyncLoader, TestOverload)
751751{
752752 AsyncLoaderTest t (3 );
753- t.loader .start ();
753+ t.loader .unpause ();
754754
755755 size_t max_threads = t.loader .getMaxThreads (/* pool = */ 0 );
756756 std::atomic<int > executing{0 };
@@ -765,12 +765,12 @@ TEST(AsyncLoader, TestOverload)
765765 executing--;
766766 };
767767
768- t.loader .stop ();
768+ t.loader .pause ();
769769 std::vector<LoadTaskPtr> tasks;
770770 tasks.reserve (concurrency);
771771 for (int i = 0 ; i < concurrency; i++)
772772 tasks.push_back (t.schedule (t.chainJobSet (5 , job_func)));
773- t.loader .start ();
773+ t.loader .unpause ();
774774 t.loader .wait ();
775775 ASSERT_EQ (executing, 0 );
776776 }
@@ -818,7 +818,7 @@ TEST(AsyncLoader, StaticPriorities)
818818 jobs.push_back (makeLoadJob ({ jobs[6 ] }, 9 , " H" , job_func)); // 7
819819 auto task = t.schedule ({ jobs.begin (), jobs.end () });
820820
821- t.loader .start ();
821+ t.loader .unpause ();
822822 t.loader .wait ();
823823 ASSERT_TRUE (schedule == " A9E9D9F9G9H9C4B3" || schedule == " A9D9E9F9G9H9C4B3" );
824824}
@@ -831,7 +831,7 @@ TEST(AsyncLoader, SimplePrioritization)
831831 {.max_threads = 1 , .priority {-2 }},
832832 });
833833
834- t.loader .start ();
834+ t.loader .unpause ();
835835
836836 std::atomic<int > executed{0 }; // Number of previously executed jobs (to test execution order)
837837 LoadJobPtr job_to_prioritize;
@@ -951,9 +951,9 @@ TEST(AsyncLoader, DynamicPriorities)
951951
952952 job_to_prioritize = jobs[6 ]; // G
953953
954- t.loader .start ();
954+ t.loader .unpause ();
955955 t.loader .wait ();
956- t.loader .stop ();
956+ t.loader .pause ();
957957
958958 if (prioritize)
959959 {
@@ -1000,7 +1000,7 @@ TEST(AsyncLoader, JobPrioritizedWhileWaited)
10001000
10011001 job_to_wait = jobs[1 ];
10021002
1003- t.loader .start ();
1003+ t.loader .unpause ();
10041004
10051005 while (job_to_wait->waitersCount () == 0 )
10061006 std::this_thread::yield ();
@@ -1011,15 +1011,15 @@ TEST(AsyncLoader, JobPrioritizedWhileWaited)
10111011 sync.arrive_and_wait ();
10121012
10131013 t.loader .wait ();
1014- t.loader .stop ();
1014+ t.loader .pause ();
10151015 ASSERT_EQ (t.loader .suspendedWorkersCount (1 ), 0 );
10161016 ASSERT_EQ (t.loader .suspendedWorkersCount (0 ), 0 );
10171017}
10181018
10191019TEST (AsyncLoader, RandomIndependentTasks)
10201020{
10211021 AsyncLoaderTest t (16 );
1022- t.loader .start ();
1022+ t.loader .unpause ();
10231023
10241024 auto job_func = [&] (AsyncLoader &, const LoadJobPtr & self)
10251025 {
@@ -1041,7 +1041,7 @@ TEST(AsyncLoader, RandomIndependentTasks)
10411041TEST (AsyncLoader, RandomDependentTasks)
10421042{
10431043 AsyncLoaderTest t (16 );
1044- t.loader .start ();
1044+ t.loader .unpause ();
10451045
10461046 std::mutex mutex;
10471047 std::condition_variable cv;
@@ -1108,7 +1108,7 @@ TEST(AsyncLoader, SetMaxThreads)
11081108 for (int i = 0 ; i < 1000 ; i++)
11091109 tasks.push_back (t.schedule ({makeLoadJob ({}, " job" , job_func)}));
11101110
1111- t.loader .start ();
1111+ t.loader .unpause ();
11121112 while (sync_index < syncs.size ())
11131113 {
11141114 // Wait for `max_threads` jobs to start executing
@@ -1132,7 +1132,7 @@ TEST(AsyncLoader, SetMaxThreads)
11321132TEST (AsyncLoader, SubJobs)
11331133{
11341134 AsyncLoaderTest t (1 );
1135- t.loader .start ();
1135+ t.loader .unpause ();
11361136
11371137 // An example of component with an asynchronous loading interface
11381138 class MyComponent : boost::noncopyable {
@@ -1195,7 +1195,7 @@ TEST(AsyncLoader, SubJobs)
11951195TEST (AsyncLoader, RecursiveJob)
11961196{
11971197 AsyncLoaderTest t (1 );
1198- t.loader .start ();
1198+ t.loader .unpause ();
11991199
12001200 // An example of component with an asynchronous loading interface (a complicated one)
12011201 class MyComponent : boost::noncopyable {
0 commit comments