- Sort Score
- Result 10 results
- Languages All
Results 1 - 9 of 9 for runtime_Semacquire (0.22 sec)
-
src/sync/runtime_sema_test.go
for pb.Next() { Runtime_Semrelease(&sem.sem, false, 0) Runtime_Semacquire(&sem.sem) } }) } func benchmarkSema(b *testing.B, block, work bool) { if b.N == 0 { return } sem := uint32(0) if block { done := make(chan bool) go func() { for p := 0; p < runtime.GOMAXPROCS(0)/2; p++ { Runtime_Semacquire(&sem) } done <- true }() defer func() { <-done }()
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Mar 05 14:59:31 UTC 2019 - 1.3K bytes - Viewed (0) -
src/sync/export_test.go
// Copyright 2012 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. package sync // Export for testing. var Runtime_Semacquire = runtime_Semacquire var Runtime_Semrelease = runtime_Semrelease var Runtime_procPin = runtime_procPin var Runtime_procUnpin = runtime_procUnpin // poolDequeue testing. type PoolDequeue interface { PushHead(val any) bool
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Nov 17 16:39:52 UTC 2023 - 1.2K bytes - Viewed (0) -
src/sync/runtime.go
// Semacquire waits until *s > 0 and then atomically decrements it. // It is intended as a simple sleep primitive for use by the synchronization // library and should not be used directly. func runtime_Semacquire(s *uint32) // Semacquire(RW)Mutex(R) is like Semacquire, but for profiling contended // Mutexes and RWMutexes. // If lifo is true, queue waiter at the head of wait queue.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Sep 16 16:32:27 UTC 2022 - 2.3K bytes - Viewed (0) -
src/internal/poll/fd_mutex.go
new = old + mutexWait if new&mutexMask == 0 { panic(overflowMsg) } } if atomic.CompareAndSwapUint64(&mu.state, old, new) { if old&mutexBit == 0 { return true } runtime_Semacquire(mutexSema) // The signaller has subtracted mutexWait. } } } // unlock removes a reference from mu and unlocks mu. // It reports whether there is no remaining reference.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Jun 20 16:55:30 UTC 2018 - 6.4K bytes - Viewed (0) -
src/sync/waitgroup.go
// As a consequence, can do the write only for the first waiter, // otherwise concurrent Waits will race with each other. race.Write(unsafe.Pointer(&wg.sema)) } runtime_Semacquire(&wg.sema) if wg.state.Load() != 0 { panic("sync: WaitGroup is reused before previous Wait has returned") } if race.Enabled { race.Enable() race.Acquire(unsafe.Pointer(wg)) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Jun 07 21:14:51 UTC 2024 - 4K bytes - Viewed (0) -
src/sync/mutex_test.go
"internal/testenv" "os" "os/exec" "runtime" "strings" . "sync" "testing" "time" ) func HammerSemaphore(s *uint32, loops int, cdone chan bool) { for i := 0; i < loops; i++ { Runtime_Semacquire(s) Runtime_Semrelease(s, false, 0) } cdone <- true } func TestSemaphore(t *testing.T) { s := new(uint32) *s = 1 c := make(chan bool) for i := 0; i < 10; i++ {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Jun 16 21:25:35 UTC 2022 - 5.9K bytes - Viewed (0) -
src/runtime/sema.go
// // Do not remove or change the type signature. // See go.dev/issue/67401. // //go:linkname sync_runtime_Semacquire sync.runtime_Semacquire func sync_runtime_Semacquire(addr *uint32) { semacquire1(addr, false, semaBlockProfile, 0, waitReasonSemacquire) } //go:linkname poll_runtime_Semacquire internal/poll.runtime_Semacquire func poll_runtime_Semacquire(addr *uint32) { semacquire1(addr, false, semaBlockProfile, 0, waitReasonSemacquire) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 29 17:58:53 UTC 2024 - 19K bytes - Viewed (0) -
src/internal/poll/fd_unix.go
// may be blocking, and that would block the Close. // No need for an atomic read of isBlocking, increfAndClose means // we have exclusive access to fd. if fd.isBlocking == 0 { runtime_Semacquire(&fd.csema) } return err } // SetBlocking puts the file into blocking mode. func (fd *FD) SetBlocking() error { if err := fd.incref(); err != nil { return err }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 31 04:09:44 UTC 2024 - 17.9K bytes - Viewed (0) -
src/internal/poll/fd_windows.go
} // unblock pending reader and writer fd.pd.evict() err := fd.decref() // Wait until the descriptor is closed. If this was the only // reference, it is already closed. runtime_Semacquire(&fd.csema) return err } // Windows ReadFile and WSARecv use DWORD (uint32) parameter to pass buffer length. // This prevents us reading blocks larger than 4GB. // See golang.org/issue/26923.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Jan 31 16:50:42 UTC 2024 - 34.1K bytes - Viewed (0)