| 477 | } |
| 478 | |
| 479 | void 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 | |
| 498 | TEST_F(ExecutionQueueTest, in_place_task) { |
| 499 | for (int i = 0; i < 2; ++i) { |
no test coverage detected