MCPcopy Create free account
hub / github.com/apache/brpc / test_in_place_task

Function test_in_place_task

test/bthread_execution_queue_unittest.cpp:479–496  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

477}
478
479void test_in_place_task(bool use_pthread) {
480 pthread_t thread_id = pthread_self();
481 bthread::ExecutionQueueId<LongIntTask> queue_id = { 0 }; // to suppress warnings
482 bthread::ExecutionQueueOptions options;
483 options.use_pthread = use_pthread;
484 if (options.use_pthread) {
485 LOG(INFO) << "================ pthread ================";
486 } else {
487 LOG(INFO) << "================ bthread ================";
488 }
489 ASSERT_EQ(0, bthread::execution_queue_start(&queue_id, &options,
490 check_running_thread,
491 (void*)thread_id));
492 ASSERT_EQ(0, bthread::execution_queue_execute(
493 queue_id, 0, &bthread::TASK_OPTIONS_INPLACE));
494 ASSERT_EQ(0, bthread::execution_queue_stop(queue_id));
495 ASSERT_EQ(0, bthread::execution_queue_join(queue_id));
496}
497
498TEST_F(ExecutionQueueTest, in_place_task) {
499 for (int i = 0; i < 2; ++i) {

Callers 1

TEST_FFunction · 0.85

Calls 4

execution_queue_startFunction · 0.85
execution_queue_executeFunction · 0.85
execution_queue_stopFunction · 0.85
execution_queue_joinFunction · 0.85

Tested by

no test coverage detected