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

Function cancel_self

test/bthread_execution_queue_unittest.cpp:686–697  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

684};
685
686int cancel_self(void* /*meta*/, bthread::TaskIterator<CancelSelf*>& iter) {
687
688 for (; iter; ++iter) {
689 while ((*iter)->handle == NULL) {
690 usleep(10);
691 }
692 EXPECT_EQ(1, bthread::execution_queue_cancel(*(*iter)->handle.load()));
693 EXPECT_EQ(1, bthread::execution_queue_cancel(*(*iter)->handle.load()));
694 EXPECT_EQ(1, bthread::execution_queue_cancel(*(*iter)->handle.load()));
695 }
696 return 0;
697}
698
699void test_cancel_self(bool use_pthread) {
700 bthread::ExecutionQueueId<CancelSelf*> queue_id = { 0 }; // to suppress warnings

Callers

nothing calls this directly

Calls 2

execution_queue_cancelFunction · 0.85
loadMethod · 0.45

Tested by

no test coverage detected