MCPcopy Create free account
hub / github.com/alibaba/PhotonLibOS / threads_create_join

Function threads_create_join

thread/thread.cpp:1564–1586  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1562 }
1563
1564 void threads_create_join(uint64_t n,
1565 thread_entry start, void* arg, uint64_t stack_size)
1566 {
1567 if (n == 0) return;
1568 thread* threads[32];
1569 thread** pthreads = threads;
1570 std::vector<thread*> _threads;
1571 if (n > 32)
1572 {
1573 _threads.resize(n);
1574 pthreads = &_threads[0];
1575 }
1576 for (uint64_t i = 0; i < n; ++i)
1577 {
1578 auto th = thread_create(start, arg, stack_size);
1579 if (!th) break;
1580 thread_enable_join(th);
1581 pthreads[i] = th;
1582 }
1583 for (uint64_t i = 0; i < n; ++i) {
1584 thread_join(pthreads[i]);
1585 }
1586 }
1587
1588 void Timer::stub()
1589 {

Callers 4

mainFunction · 0.85
do_testFunction · 0.85
photon_doFunction · 0.85
prepare_copied_fsFunction · 0.85

Calls 4

thread_createFunction · 0.85
thread_enable_joinFunction · 0.85
thread_joinFunction · 0.85
resizeMethod · 0.45

Tested by 4

mainFunction · 0.68
do_testFunction · 0.68
photon_doFunction · 0.68
prepare_copied_fsFunction · 0.68