MCPcopy Create free account
hub / github.com/Tencent/libco / main

Function main

example_copystack.cpp:44–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44int main()
45{
46 stShareStack_t* share_stack= co_alloc_sharestack(1, 1024 * 128);
47 stCoRoutineAttr_t attr;
48 attr.stack_size = 0;
49 attr.share_stack = share_stack;
50
51 stCoRoutine_t* co[2];
52 int routineid[2];
53 for (int i = 0; i < 2; i++)
54 {
55 routineid[i] = i;
56 co_create(&co[i], &attr, RoutineFunc, routineid + i);
57 co_resume(co[i]);
58 }
59 co_eventloop(co_get_epoll_ct(), NULL, NULL);
60 return 0;
61}

Callers

nothing calls this directly

Calls 5

co_alloc_sharestackFunction · 0.85
co_createFunction · 0.85
co_resumeFunction · 0.85
co_eventloopFunction · 0.85
co_get_epoll_ctFunction · 0.85

Tested by

no test coverage detected