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

Function co_func

example_closure.cpp:58–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56 for(int i=0;i<10;i++)
57 {
58 co_func( f,ref,i )
59 {
60 printf("ref.total %d i %d\n",ref.total,i );
61 //lock
62 pthread_mutex_lock(&ref.m);
63 ref.v2.push_back( i );
64 pthread_mutex_unlock(&ref.m);
65 //unlock
66 }
67 co_func_end;
68 v.push_back( new f( ref,i ) );
69 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected