-f9e44c6e510df9f047dbe28eb5fa19642e350f8f
+c8456995b0118a92820c6c1d8f996d4b1adf55c2
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
Type* uint16_type = Type::lookup_integer_type("uint16");
Type* int64_type = Type::lookup_integer_type("int64");
scase_type =
- Type::make_builtin_struct_type(4,
+ Type::make_builtin_struct_type(3,
"c", unsafe_pointer_type,
"elem", unsafe_pointer_type,
- "kind", uint16_type,
- "releasetime", int64_type);
+ "kind", uint16_type);
scase_type->set_is_struct_incomparable();
}
return scase_type;
// Known to compiler.
// Changes here must also be made in src/cmd/internal/gc/select.go's scasetype.
type scase struct {
- c *hchan // chan
- elem unsafe.Pointer // data element
- kind uint16
- releasetime int64
+ c *hchan // chan
+ elem unsafe.Pointer // data element
+ kind uint16
}
func sellock(scases []scase, lockorder []uint16) {
var t0 int64
if blockprofilerate > 0 {
t0 = cputicks()
- for i := 0; i < ncases; i++ {
- scases[i].releasetime = -1
- }
}
// The compiler rewrites selects that statically have
var dfl *scase
var casi int
var cas *scase
+ var caseReleaseTime int64 = -1
var recvOK bool
for i := 0; i < ncases; i++ {
casi = int(pollorder[i])
if k.kind == caseNil {
continue
}
- if sglist.releasetime > 0 {
- k.releasetime = sglist.releasetime
- }
if sg == sglist {
// sg has already been dequeued by the G that woke us up.
casi = int(casei)
cas = k
+ if sglist.releasetime > 0 {
+ caseReleaseTime = sglist.releasetime
+ }
} else {
c = k.c
if k.kind == caseSend {
goto retc
retc:
- if cas.releasetime > 0 {
- blockevent(cas.releasetime-t0, 1)
+ if caseReleaseTime > 0 {
+ blockevent(caseReleaseTime-t0, 1)
}
// Check preemption, since unlike gc we don't check on every call.