Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 61 for goexit0 (0.23 sec)

  1. src/runtime/preempt.go

    			throw("invalid g status")
    
    		case _Gdead:
    			// Nothing to suspend.
    			//
    			// preemptStop may need to be cleared, but
    			// doing that here could race with goroutine
    			// reuse. Instead, goexit0 clears it.
    			return suspendGState{dead: true}
    
    		case _Gcopystack:
    			// The stack is being copied. We need to wait
    			// until this is done.
    
    		case _Gpreempted:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 15:41:45 UTC 2024
    - 15.1K bytes
    - Viewed (0)
  2. src/iter/pull_test.go

    	return func(yield func(int) bool) {
    		runtime.Goexit()
    	}
    }
    
    func goexitCleanupSeq() Seq[int] {
    	return func(yield func(int) bool) {
    		for {
    			if !yield(55) {
    				runtime.Goexit()
    			}
    		}
    	}
    }
    
    func TestPull2Goexit(t *testing.T) {
    	t.Run("next", func(t *testing.T) {
    		var next func() (int, int, bool)
    		var stop func()
    		if !goexits(t, func() {
    			next, stop = Pull2(goexitSeq2())
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 19:09:28 UTC 2024
    - 10.2K bytes
    - Viewed (0)
  3. src/runtime/proc.go

    	schedule()
    }
    
    // Finishes execution of the current goroutine.
    func goexit1() {
    	if raceenabled {
    		racegoend()
    	}
    	trace := traceAcquire()
    	if trace.ok() {
    		trace.GoEnd()
    		traceRelease(trace)
    	}
    	mcall(goexit0)
    }
    
    // goexit continuation on g0.
    func goexit0(gp *g) {
    	gdestroy(gp)
    	schedule()
    }
    
    func gdestroy(gp *g) {
    	mp := getg().m
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 207.5K bytes
    - Viewed (0)
  4. src/iter/iter.go

    			// Propagate panics and goexits from seq.
    			if panicValue != nil {
    				if panicValue == goexitPanicValue {
    					// Propagate runtime.Goexit from seq.
    					runtime.Goexit()
    				} else {
    					panic(panicValue)
    				}
    			}
    		}
    	}
    	return next, stop
    }
    
    // goexitPanicValue is a sentinel value indicating that an iterator
    // exited via runtime.Goexit.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 19:09:28 UTC 2024
    - 6.6K bytes
    - Viewed (0)
  5. src/runtime/stubs.go

    type neverCallThisFunction struct{}
    
    // goexit is the return stub at the top of every goroutine call stack.
    // Each goroutine stack is constructed as if goexit called the
    // goroutine's entry point function, so that when the entry point
    // function returns, it will return to goexit, which will call goexit1
    // to perform the actual exit.
    //
    // This function must never be called directly. Call goexit1 instead.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 20.2K bytes
    - Viewed (0)
  6. src/runtime/testdata/testprog/deadlock.go

    	// 3. call goexit
    	// Goexit runs the #2 defer. Its panic
    	// is caught by the #1 defer.  For Goexit, we explicitly
    	// resume execution in the Goexit loop, instead of resuming
    	// execution in the caller (which would make the Goexit disappear!)
    	defer func() {
    		r := recover()
    		if r == nil {
    			panic("bad recover")
    		}
    	}()
    	defer func() {
    		panic("hello")
    	}()
    	runtime.Goexit()
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 27 20:44:24 UTC 2021
    - 6.5K bytes
    - Viewed (0)
  7. src/runtime/panic.go

    // If all other goroutines exit, the program crashes.
    func Goexit() {
    	// Create a panic object for Goexit, so we can recognize when it might be
    	// bypassed by a recover().
    	var p _panic
    	p.goexit = true
    
    	p.start(getcallerpc(), unsafe.Pointer(getcallersp()))
    	for {
    		fn, ok := p.nextDefer()
    		if !ok {
    			break
    		}
    		fn()
    	}
    
    	goexit1()
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 43.8K bytes
    - Viewed (0)
  8. src/cmd/go/testdata/script/test_example_goexit.txt

    stdout '(?s)--- PASS.*--- FAIL.*'
    stdout 'panic: test executed panic\(nil\) or runtime\.Goexit'
    
    -- go.mod --
    module examplegoexit
    
    go 1.16
    -- example_test.go --
    package main
    
    import (
    	"fmt"
    	"runtime"
    )
    
    func ExamplePass() {
    	fmt.Println("pass")
    	// Output:
    	// pass
    }
    
    func ExampleGoexit() {
    	runtime.Goexit()
    	// Output:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Sep 17 13:25:29 UTC 2020
    - 403 bytes
    - Viewed (0)
  9. test/fixedbugs/issue8158.go

    	go f2(c)
    	<-c
    }
    
    func f1(done chan bool) {
    	defer func() {
    		recover()
    		done <- true
    		runtime.Goexit() // left stack-allocated Panic struct on gp->panic stack
    	}()
    	panic("p")
    }
    
    func f2(done chan bool) {
    	defer func() {
    		recover()
    		done <- true
    		runtime.Goexit()
    	}()
    	time.Sleep(10 * time.Millisecond) // overwrote Panic struct with Timer struct
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 767 bytes
    - Viewed (0)
  10. test/fixedbugs/issue5963.go

    	defer func() {
    		c <- 0
    	}()
    	go func() {
    		os.Exit(<-c)
    	}()
    	runtime.Goexit()
    }
    
    func main() {
    }
    
    /* Before fix:
    
    invalid m->locked = 2
    fatal error: internal lockOSThread error
    
    goroutine 2 [runnable]:
    runtime.MHeap_Scavenger()
    	/Users/rsc/g/go/src/pkg/runtime/mheap.c:438
    runtime.goexit()
    	/Users/rsc/g/go/src/pkg/runtime/proc.c:1313
    created by runtime.main
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 929 bytes
    - Viewed (0)
Back to top