Source File
note_other.go
Belonging Package
runtime
// Copyright 2024 The Go Authors. All rights reserved.// Use of this source code is governed by a BSD-style// license that can be found in the LICENSE file.//go:build !jspackage runtime// sleep and wakeup on one-time events.// before any calls to notesleep or notewakeup,// must call noteclear to initialize the Note.// then, exactly one thread can call notesleep// and exactly one thread can call notewakeup (once).// once notewakeup has been called, the notesleep// will return. future notesleep will return immediately.// subsequent noteclear must be called only after// previous notesleep has returned, e.g. it's disallowed// to call noteclear straight after notewakeup.//// notetsleep is like notesleep but wakes up after// a given number of nanoseconds even if the event// has not yet happened. if a goroutine uses notetsleep to// wake up early, it must wait to call noteclear until it// can be sure that no other goroutine is calling// notewakeup.//// notesleep/notetsleep are generally called on g0,// notetsleepg is similar to notetsleep but is called on user g.type note struct {// Futex-based impl treats it as uint32 key,// while sema-based impl as M* waitm.key uintptr}
![]() |
The pages are generated with Golds v0.7.9-preview. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |