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

Function Join

co_routine.cpp:239–266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237
238template <class TNode,class TLink>
239void inline Join( TLink*apLink,TLink *apOther )
240{
241 //printf("apOther %p\n",apOther);
242 if( !apOther->head )
243 {
244 return ;
245 }
246 TNode *lp = apOther->head;
247 while( lp )
248 {
249 lp->pLink = apLink;
250 lp = lp->pNext;
251 }
252 lp = apOther->head;
253 if(apLink->tail)
254 {
255 apLink->tail->pNext = (TNode*)lp;
256 lp->pPrev = apLink->tail;
257 apLink->tail = apOther->tail;
258 }
259 else
260 {
261 apLink->head = apOther->head;
262 apLink->tail = apOther->tail;
263 }
264
265 apOther->head = apOther->tail = NULL;
266}
267
268/////////////////for copy stack //////////////////////////
269stStackMem_t* co_alloc_stackmem(unsigned int stack_size)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected