Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 56 for lockOSThread (0.26 sec)

  1. src/runtime/proc.go

    //
    // All init functions are run on the startup thread. Calling LockOSThread
    // from an init function will cause the main function to be invoked on
    // that thread.
    //
    // A goroutine should call LockOSThread before calling OS services or
    // non-Go library functions that depend on per-thread state.
    //
    //go:nosplit
    func LockOSThread() {
    	if atomic.Load(&newmHandoff.haveTemplateThread) == 0 && GOOS != "plan9" {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 207.5K bytes
    - Viewed (0)
  2. src/net/lookup_windows.go

    		err   error
    	}
    	ch := make(chan result) // unbuffered
    	go func() {
    		if err := acquireThread(ctx); err != nil {
    			ch <- result{err: mapErr(err)}
    			return
    		}
    		defer releaseThread()
    		runtime.LockOSThread()
    		defer runtime.UnlockOSThread()
    		proto, err := getprotobyname(name)
    		select {
    		case ch <- result{proto: proto, err: err}:
    		case <-ctx.Done():
    		}
    	}()
    	select {
    	case r := <-ch:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Apr 14 18:23:45 UTC 2024
    - 14.2K bytes
    - Viewed (0)
  3. src/runtime/syscall_windows_test.go

    	}
    }
    
    func TestCallbackGC(t *testing.T) {
    	nestedCall(t, runtime.GC)
    }
    
    func TestCallbackPanicLocked(t *testing.T) {
    	runtime.LockOSThread()
    	defer runtime.UnlockOSThread()
    
    	if !runtime.LockedOSThread() {
    		t.Fatal("runtime.LockOSThread didn't")
    	}
    	defer func() {
    		s := recover()
    		if s == nil {
    			t.Fatal("did not panic")
    		}
    		if s.(string) != "callback panic" {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Aug 31 16:31:35 UTC 2023
    - 32.5K bytes
    - Viewed (0)
  4. src/syscall/exec_plan9.go

    func startProcess(argv0 string, argv []string, attr *ProcAttr) (pid int, err error) {
    	type forkRet struct {
    		pid int
    		err error
    	}
    
    	forkc := make(chan forkRet, 1)
    	go func() {
    		runtime.LockOSThread()
    		var ret forkRet
    
    		ret.pid, ret.err = forkExec(argv0, argv, attr)
    		// If fork fails there is nothing to wait for.
    		if ret.err != nil || ret.pid == 0 {
    			forkc <- ret
    			return
    		}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 21:03:59 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  5. src/syscall/exec_linux.go

    	Size        int // Size.
    }
    
    type SysProcAttr struct {
    	Chroot     string      // Chroot.
    	Credential *Credential // Credential.
    	// Ptrace tells the child to call ptrace(PTRACE_TRACEME).
    	// Call runtime.LockOSThread before starting a process with this set,
    	// and don't call UnlockOSThread until done with PtraceSyscall calls.
    	Ptrace bool
    	Setsid bool // Create session.
    	// Setpgid sets the process group ID of the child to Pgid,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 07:45:37 UTC 2024
    - 23K bytes
    - Viewed (0)
  6. src/runtime/runtime2.go

    	lockedg       guintptr
    	createstack   [32]uintptr // stack that created this thread, it's used for StackRecord.Stack0, so it must align with it.
    	lockedExt     uint32      // tracking for external LockOSThread
    	lockedInt     uint32      // tracking for internal lockOSThread
    	nextwaitm     muintptr    // next m waiting for lock
    
    	mLockProfile mLockProfile // fields relating to runtime.lock contention
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 17:57:37 UTC 2024
    - 47.9K bytes
    - Viewed (0)
  7. src/runtime/stack_test.go

    		growStack(nil)
    		growDuration = time.Since(start)
    	}()
    	wg.Wait()
    	t.Log("first growStack took", growDuration)
    
    	// in locked goroutine
    	wg.Add(1)
    	go func() {
    		defer wg.Done()
    		LockOSThread()
    		growStack(nil)
    		UnlockOSThread()
    	}()
    	wg.Wait()
    
    	// in finalizer
    	var finalizerStart time.Time
    	var started atomic.Bool
    	var progress atomic.Uint32
    	wg.Add(1)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jun 14 00:03:57 UTC 2023
    - 23.1K bytes
    - Viewed (0)
  8. src/os/os_test.go

    			if i%2 == 1 {
    				// On Plan 9, after calling LockOSThread, the goroutines
    				// run on different processes which don't share the working
    				// directory. This used to be an issue because Go expects
    				// the working directory to be program-wide.
    				// See issue 9428.
    				runtime.LockOSThread()
    			}
    			select {
    			case <-done:
    				return
    			case <-hold:
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 83.1K bytes
    - Viewed (0)
  9. src/runtime/signal_unix.go

    	disableSigChan = make(chan uint32)
    	enableSigChan = make(chan uint32)
    	go func() {
    		// Signal masks are per-thread, so make sure this goroutine stays on one
    		// thread.
    		LockOSThread()
    		defer UnlockOSThread()
    		// The sigBlocked mask contains the signals not active for os/signal,
    		// initially all signals except the essential. When signal.Notify()/Stop is called,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 10 16:04:54 UTC 2024
    - 45K bytes
    - Viewed (0)
  10. src/os/os_windows_test.go

    			},
    		)
    	} else {
    		t.Log(`skipping "use_mklink_cmd" test, mklink does not supports directory symbolic links`)
    	}
    
    	// The rest of these test requires SeCreateSymbolicLinkPrivilege to be held.
    	runtime.LockOSThread()
    	defer runtime.UnlockOSThread()
    
    	err := windows.ImpersonateSelf(windows.SecurityImpersonation)
    	if err != nil {
    		t.Fatal(err)
    	}
    	defer windows.RevertToSelf()
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 41.8K bytes
    - Viewed (0)
Back to top