Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 56 for lockOSThread (0.56 sec)

  1. src/runtime/testdata/testprog/lockosthread.go

    	registerInit("LockOSThreadAlt", func() {
    		// Lock the OS thread now so main runs on the main thread.
    		runtime.LockOSThread()
    	})
    	register("LockOSThreadAlt", LockOSThreadAlt)
    
    	registerInit("LockOSThreadAvoidsStatePropagation", func() {
    		// Lock the OS thread now so main runs on the main thread.
    		runtime.LockOSThread()
    	})
    	register("LockOSThreadAvoidsStatePropagation", LockOSThreadAvoidsStatePropagation)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 21 20:00:09 UTC 2024
    - 6.6K bytes
    - Viewed (0)
  2. src/runtime/testdata/testprogcgo/lockosthread.go

    		mainThread = C.pthread_self()
    	})
    	register("LockOSThreadMain", LockOSThreadMain)
    
    	registerInit("LockOSThreadAlt", func() {
    		// Lock the OS thread now so main runs on the main thread.
    		runtime.LockOSThread()
    	})
    	register("LockOSThreadAlt", LockOSThreadAlt)
    }
    
    func LockOSThreadMain() {
    	// This requires GOMAXPROCS=1 from the beginning to reliably
    	// start a goroutine on the main thread.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 02 20:21:33 UTC 2023
    - 2.5K bytes
    - Viewed (0)
  3. src/runtime/testdata/testprogcgo/lockosthread.c

    Austin Clements <******@****.***> 1497644472 -0400
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 11 17:47:21 UTC 2017
    - 301 bytes
    - Viewed (0)
  4. src/runtime/testdata/testprog/coro.go

    	n := 0
    	next, _ := iter.Pull(i)
    	for {
    		runtime.LockOSThread()
    		n++
    		v, ok := next()
    		if !ok {
    			break
    		}
    		if v != 5 {
    			return fmt.Errorf("bad iterator: wanted value %d, got %d", 5, v)
    		}
    	}
    	for range n {
    		runtime.UnlockOSThread()
    	}
    	return nil
    }
    
    func callerStopLocked(i iter.Seq[int]) error {
    	runtime.LockOSThread()
    	next, stop := iter.Pull(i)
    	v, _ := next()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 19:46:10 UTC 2024
    - 3.6K bytes
    - Viewed (0)
  5. src/cmd/cgo/internal/testsanitizers/testdata/tsan.go

    int getVal() {
    	return val;
    }
    
    void setVal(int i) {
    	val = i;
    }
    */
    import "C"
    
    import (
    	"runtime"
    )
    
    func main() {
    	runtime.LockOSThread()
    	C.setVal(1)
    	c := make(chan bool)
    	go func() {
    		runtime.LockOSThread()
    		C.setVal(2)
    		c <- true
    	}()
    	<-c
    	if v := C.getVal(); v != 2 {
    		panic(v)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 700 bytes
    - Viewed (0)
  6. src/runtime/testdata/testprogcgo/crash.go

    	var s *string
    	_ = *s
    	fmt.Print("SHOULD NOT BE HERE")
    }
    
    func testInNewThread(name string) {
    	c := make(chan bool)
    	go func() {
    		runtime.LockOSThread()
    		test(name)
    		c <- true
    	}()
    	<-c
    }
    
    func Crash() {
    	runtime.LockOSThread()
    	test("main")
    	testInNewThread("new-thread")
    	testInNewThread("second-new-thread")
    	test("main-again")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 23:34:33 UTC 2016
    - 743 bytes
    - Viewed (0)
  7. src/cmd/cgo/internal/testsanitizers/testdata/tsan2.go

    }
    
    void setVal(int) __attribute__ ((weak));
    
    void setVal(int i) {
    	val = i;
    }
    */
    import "C"
    
    import "runtime"
    
    //export GoRun
    func GoRun() {
    	runtime.LockOSThread()
    	c := make(chan bool)
    	go func() {
    		runtime.LockOSThread()
    		C.setVal(2)
    		c <- true
    	}()
    	<-c
    }
    
    func main() {
    	if v := C.run(); v != 2 {
    		panic(v)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 940 bytes
    - Viewed (0)
  8. src/runtime/runtime_linux_test.go

    func init() {
    	// Record pid and tid of init thread for use during test.
    	// The call to LockOSThread is just to exercise it;
    	// we can't test that it does anything.
    	// Instead we're testing that the conditions are good
    	// for how it is used in init (must be on main thread).
    	pid, tid = syscall.Getpid(), syscall.Gettid()
    	LockOSThread()
    
    	sysNanosleep = func(d time.Duration) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 21 20:20:01 UTC 2023
    - 1.8K bytes
    - Viewed (0)
  9. src/runtime/testdata/testprogcgo/cgo.go

    	start := time.Now()
    	var times []time.Duration
    	n := 64
    	if os.Getenv("RUNTIME_TEST_SHORT") != "" {
    		n = 16
    	}
    	for i := 0; i < n; i++ {
    		go func() {
    			runtime.LockOSThread()
    			select {}
    		}()
    		go func() {
    			runtime.LockOSThread()
    			select {}
    		}()
    		time.Sleep(time.Millisecond)
    		ping <- false
    		select {
    		case <-ping:
    			times = append(times, time.Since(start))
    		case <-time.After(time.Second):
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 31 13:20:27 UTC 2017
    - 1.8K bytes
    - Viewed (0)
  10. src/internal/trace/testdata/testprog/stress.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    // Tests a many interesting cases (network, syscalls, a little GC, busy goroutines,
    // blocked goroutines, LockOSThread, pipes, and GOMAXPROCS).
    
    //go:build ignore
    
    package main
    
    import (
    	"log"
    	"net"
    	"os"
    	"runtime"
    	"runtime/trace"
    	"sync"
    	"time"
    )
    
    func main() {
    	var wg sync.WaitGroup
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 2.5K bytes
    - Viewed (0)
Back to top