- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 56 for lockOSThread (0.22 sec)
-
src/runtime/testdata/testprog/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") } type P string func (p P) String() string {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 08 19:10:41 UTC 2024 - 2.5K bytes - Viewed (0) -
src/internal/trace/testdata/testprog/stress-start-stop.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 ( "bytes" "io" "log" "net" "os" "runtime" "runtime/trace" "sync" "time" ) func main() {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 17 18:48:18 UTC 2024 - 2.7K bytes - Viewed (0) -
src/syscall/pwd_plan9.go
// (locked to OS thread). Otherwise return false. func fixwd(paths ...string) bool { for _, path := range paths { if path != "" && path[0] != '/' && path[0] != '#' { runtime.LockOSThread() Fixwd() return true } } return false } // goroutine-specific getwd func getwd() (wd string, err error) { fd, err := open(".", O_RDONLY) if err != nil { return "", err }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Feb 26 21:03:59 UTC 2024 - 2.3K bytes - Viewed (0) -
src/runtime/testdata/testprog/deadlock.go
func SimpleDeadlock() { select {} panic("not reached") } func InitDeadlock() { select {} panic("not reached") } func LockedDeadlock() { runtime.LockOSThread() select {} } func LockedDeadlock2() { go func() { runtime.LockOSThread() select {} }() time.Sleep(time.Millisecond) select {} } func GoexitDeadlock() { F := func() { for i := 0; i < 10; i++ { } }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Jan 27 20:44:24 UTC 2021 - 6.5K bytes - Viewed (0) -
src/cmd/cgo/internal/test/setgid2_linux.go
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 12 12:00:02 UTC 2023 - 681 bytes - Viewed (0) -
src/cmd/cgo/internal/testcshared/testdata/libgo4/libgo4.go
// The idea is to get some threads going, so that a signal will be delivered // to a thread started by Go. // //export RunGoroutines func RunGoroutines() { for i := 0; i < 4; i++ { go func() { runtime.LockOSThread() select {} }() } } var P *byte // TestSEGV makes sure that an invalid address turns into a run-time Go panic. // //export TestSEGV func TestSEGV() { defer func() {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 12 11:59:56 UTC 2023 - 864 bytes - Viewed (0) -
misc/cgo/gmp/fib.go
) func fibber(c chan *big.Int, out chan string, n int64) { // Keep the fibbers in dedicated operating system // threads, so that this program tests coordination // between pthreads and not just goroutines. runtime.LockOSThread() i := big.NewInt(n) if n == 0 { c <- i } for { j := <-c out <- j.String() i.Add(i, j) c <- i } } func main() { c := make(chan *big.Int)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Apr 10 22:32:35 UTC 2023 - 919 bytes - Viewed (0) -
src/cmd/cgo/internal/teststdio/testdata/chain.go
const R = 5 func link(left chan<- int, right <-chan int) { // Keep the links in dedicated operating system // threads, so that this program tests coordination // between pthreads and not just goroutines. runtime.LockOSThread() for { v := <-right stdio.Stdout.WriteString(strconv.Itoa(v) + "\n") left <- 1 + v } } func main() { leftmost := make(chan int) var left chan int right := leftmost
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 12 11:59:56 UTC 2023 - 914 bytes - Viewed (0) -
src/runtime/testdata/testprog/syscall_windows.go
func StackMemory() { mem1, err := getPagefileUsage() if err != nil { panic(err) } const threadCount = 100 var wg sync.WaitGroup for i := 0; i < threadCount; i++ { wg.Add(1) go func() { runtime.LockOSThread() wg.Done() select {} }() } wg.Wait() mem2, err := getPagefileUsage() if err != nil { panic(err) } // assumes that this process creates 1 thread for each
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Oct 23 17:31:31 UTC 2023 - 1.5K bytes - Viewed (0) -
src/cmd/cgo/internal/teststdio/testdata/fib.go
) func fibber(c, out chan int64, i int64) { // Keep the fibbers in dedicated operating system // threads, so that this program tests coordination // between pthreads and not just goroutines. runtime.LockOSThread() if i == 0 { c <- i } for { j := <-c stdio.Stdout.WriteString(strconv.FormatInt(j, 10) + "\n") out <- j <-out i += j c <- i } } func main() {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 12 11:59:56 UTC 2023 - 965 bytes - Viewed (0)