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

Function push_thread_with_id

test/bthread_execution_queue_unittest.cpp:415–423  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

413butil::atomic<int> num_threads(0);
414
415void* push_thread_with_id(void* arg) {
416 bthread::ExecutionQueueId<LongIntTask> id = { (uint64_t)arg };
417 int thread_id = num_threads.fetch_add(1, butil::memory_order_relaxed);
418 LOG(INFO) << "Start thread" << thread_id;
419 for (int i = 0; i < 100000; ++i) {
420 bthread::execution_queue_execute(id, ((long)thread_id << 32) | i);
421 }
422 return NULL;
423}
424
425int check_order(void* meta, bthread::TaskIterator<LongIntTask>& iter) {
426 for (; iter; ++iter) {

Callers

nothing calls this directly

Calls 2

execution_queue_executeFunction · 0.85
fetch_addMethod · 0.80

Tested by

no test coverage detected