- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 2,139 for selectA (0.11 sec)
-
src/cmd/compile/internal/test/testdata/pgo/devirtualize/devirt.go
// The call below must evaluate selectA() to determine the receiver to // use. This should happen exactly once per iteration. Assert that is // the case to ensure the IR manipulation does not result in over- or // under-evaluation. selectI := 0 selectA := func(gotI int) Adder { if gotI != selectI { panic(fmt.Sprintf("selectA not called once per iteration; got i %d want %d", gotI, selectI)) } selectI++
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Nov 13 18:17:57 UTC 2023 - 6.2K bytes - Viewed (0) -
test/reorder2.go
c <- 1 select { default: case <-c: if a("1")("2")("3"); log != "a(1)a(2)a(3)" { println("in select4, expecting a(1)a(2)a(3) , got ", log) err++ } log = "" if t.a("1").a(t.b("2")); log != "a(1)b(2)a(2)" { println("in select4, expecting a(1)b(2)a(2), got ", log) err++ } log = "" if a("3")(b("4"))(b("5")); log != "a(3)b(4)a(4)b(5)a(5)" {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon May 02 13:43:18 UTC 2016 - 7.2K bytes - Viewed (0) -
test/chan/select3.go
testBlock(always, func() { ch := make(chan int) <-ch }) // empty selects always block testBlock(always, func() { select {} }) // selects with only nil channels always block testBlock(always, func() { select { case <-nilch: unreachable() } }) testBlock(always, func() { select { case nilch <- 7: unreachable() } }) testBlock(always, func() {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Sat Jul 08 02:10:12 UTC 2017 - 4.1K bytes - Viewed (0) -
test/chan/select8.go
// Test break statements in a select. // Gccgo had a bug in handling this. // Test 1,2,3-case selects, so it covers both the general // code path and the specialized optimizations for one- // and two-case selects. package main var ch = make(chan int) func main() { go func() { for { ch <- 5 } }() select { case <-ch: break panic("unreachable") }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Jul 10 18:02:11 UTC 2019 - 826 bytes - Viewed (0) -
test/chan/select2.go
// license that can be found in the LICENSE file. // Test that selects do not consume undue memory. package main import "runtime" func sender(c chan int, n int) { for i := 0; i < n; i++ { c <- 1 } } func receiver(c, dummy chan int, n int) { for i := 0; i < n; i++ { select { case <-c: // nothing case <-dummy: panic("dummy") } } }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon May 02 13:43:18 UTC 2016 - 1K bytes - Viewed (0) -
test/chan/select5.go
order = 0 c <- n {{if .Maybe}} {{/* Outside of select, left-to-right rule applies. */}} {{/* (Inside select, assignment waits until case is chosen, */}} {{/* so right hand side happens before anything on left hand side. */}} *fp(&x, 1) = <-fc(c, 2) {{else}}{{if .Maybe}} m[fn(13, 1)] = <-fc(c, 2) x = m[13] {{else}} select { {{/* Blocking or non-blocking, before the receive. */}}
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon May 02 13:43:18 UTC 2016 - 10K bytes - Viewed (0) -
src/runtime/select.go
// nil. // // selectgo returns the index of the chosen scase, which matches the // ordinal position of its respective select{recv,send,default} call. // Also, if the chosen scase was a receive operation, it reports whether // a value was received. func selectgo(cas0 *scase, order0 *uint16, pc0 *uintptr, nsends, nrecvs int, block bool) (int, bool) { if debugSelect { print("select: cas0=", cas0, "\n") }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Mar 13 21:36:04 UTC 2024 - 15K bytes - Viewed (0) -
test/chan/select6.go
// Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Test for select: Issue 2075 // A bug in select corrupts channel queues of failed cases // if there are multiple waiters on those channels and the // select is the last in the queue. If further waits are made // on the channel without draining it first then those waiters
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon May 02 13:43:18 UTC 2016 - 783 bytes - Viewed (0) -
src/cmd/compile/internal/walk/select.go
// optimization: zero-case select if ncas == 0 { return []ir.Node{mkcallstmt("block")} } // optimization: one-case select: single op. if ncas == 1 { cas := cases[0] ir.SetPos(cas) l := cas.Init() if cas.Comm != nil { // not default: n := cas.Comm l = append(l, ir.TakeInit(n)...) switch n.Op() { default: base.Fatalf("select %v", n.Op()) case ir.OSEND:
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Aug 22 01:53:41 UTC 2023 - 7.8K bytes - Viewed (0) -
test/chan/select.go
// Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Test simple select. package main var counter uint var shift uint func GetValue() uint { counter++ return 1 << shift } func Send(a, b chan uint) int { var i int LOOP: for { select { case a <- GetValue(): i++ a = nil case b <- GetValue(): i++ b = nil default:
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Sun Feb 19 06:44:02 UTC 2012 - 913 bytes - Viewed (0)