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

Function main

example_cond.cpp:68–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66 return NULL;
67}
68int main()
69{
70 stEnv_t* env = new stEnv_t;
71 env->cond = co_cond_alloc();
72
73 stCoRoutine_t* consumer_routine;
74 co_create(&consumer_routine, NULL, Consumer, env);
75 co_resume(consumer_routine);
76
77 stCoRoutine_t* producer_routine;
78 co_create(&producer_routine, NULL, Producer, env);
79 co_resume(producer_routine);
80
81 co_eventloop(co_get_epoll_ct(), NULL, NULL);
82 return 0;
83}

Callers

nothing calls this directly

Calls 5

co_cond_allocFunction · 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