void runtime·selectdefault(Select *sel, bool selected) { selected = false; FLUSH(&selected); selectdefault(sel, runtime·getcallerpc(&sel), (byte*)&selected - (byte*)&sel); }
void runtime·selectdefault(Select* sel, bool selected) { selected = 0; FLUSH(&selected); #line 557 "/tmp/makerelease402042453/go/src/pkg/runtime/chan.goc" selected = false; selectdefault(sel, runtime·getcallerpc(&sel), (byte*)&selected - (byte*)&sel); FLUSH(&selected); }
void runtime·selectdefault(Select* sel, bool selected) { selected = 0; FLUSH(&selected); #line 559 "/home/14/ren/source/golang/go/src/pkg/runtime/chan.goc" selected = false; selectdefault(sel, runtime·getcallerpc(&sel), (byte*)&selected - (byte*)&sel); FLUSH(&selected); }
void reflect·rselect(Slice cases, intgo chosen, bool recvOK) { chosen = 0; FLUSH(&chosen); recvOK = 0; FLUSH(&recvOK); #line 990 "/tmp/makerelease402042453/go/src/pkg/runtime/chan.goc" int32 i; Select *sel; runtimeSelect* rcase, *rc; chosen = -1; recvOK = false; rcase = (runtimeSelect*)cases.array; sel = newselect(cases.len); for(i=0; i<cases.len; i++) { rc = &rcase[i]; switch(rc->dir) { case SelectDefault: selectdefault(sel, (void*)i, 0); break; case SelectSend: if(rc->ch == nil) break; selectsend(sel, rc->ch, (void*)i, rc->val, 0); break; case SelectRecv: if(rc->ch == nil) break; selectrecv(sel, rc->ch, (void*)i, rc->val, &recvOK, 0); break; } } chosen = (intgo)(uintptr)selectgo(&sel); FLUSH(&chosen); FLUSH(&recvOK); }
// func rselect(cases []runtimeSelect) (chosen int, word uintptr, recvOK bool) void reflect·rselect(Slice cases, intgo chosen, uintptr word, bool recvOK) { int32 i; Select *sel; runtimeSelect* rcase, *rc; void *elem; void *recvptr; uintptr maxsize; chosen = -1; word = 0; recvOK = false; maxsize = 0; rcase = (runtimeSelect*)cases.array; for(i=0; i<cases.len; i++) { rc = &rcase[i]; if(rc->dir == SelectRecv && rc->ch != nil && maxsize < rc->typ->elem->size) maxsize = rc->typ->elem->size; } recvptr = nil; if(maxsize > sizeof(void*)) recvptr = runtime·mal(maxsize); newselect(cases.len, &sel); for(i=0; i<cases.len; i++) { rc = &rcase[i]; switch(rc->dir) { case SelectDefault: selectdefault(sel, (void*)i, 0); break; case SelectSend: if(rc->ch == nil) break; if(rc->typ->elem->size > sizeof(void*)) elem = (void*)rc->val; else elem = (void*)&rc->val; selectsend(sel, rc->ch, (void*)i, elem, 0); break; case SelectRecv: if(rc->ch == nil) break; if(rc->typ->elem->size > sizeof(void*)) elem = recvptr; else elem = &word; selectrecv(sel, rc->ch, (void*)i, elem, &recvOK, 0); break; } } chosen = (intgo)(uintptr)selectgo(&sel); if(rcase[chosen].dir == SelectRecv && rcase[chosen].typ->elem->size > sizeof(void*)) word = (uintptr)recvptr; FLUSH(&chosen); FLUSH(&word); FLUSH(&recvOK); }