Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for runtime_Semrelease (0.31 sec)

  1. src/internal/poll/fd_mutex.go

    			// Wake all read and write waiters,
    			// they will observe closed flag after wakeup.
    			for old&mutexRMask != 0 {
    				old -= mutexRWait
    				runtime_Semrelease(&mu.rsema)
    			}
    			for old&mutexWMask != 0 {
    				old -= mutexWWait
    				runtime_Semrelease(&mu.wsema)
    			}
    			return true
    		}
    	}
    }
    
    // decref removes a reference from 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)
  2. src/sync/runtime_sema_test.go

    		defer func() {
    			<-done
    		}()
    	}
    	b.RunParallel(func(pb *testing.PB) {
    		foo := 0
    		for pb.Next() {
    			Runtime_Semrelease(&sem, false, 0)
    			if work {
    				for i := 0; i < 100; i++ {
    					foo *= 2
    					foo /= 2
    				}
    			}
    			Runtime_Semacquire(&sem)
    		}
    		_ = foo
    		Runtime_Semrelease(&sem, false, 0)
    	})
    }
    
    func BenchmarkSemaSyntNonblock(b *testing.B) {
    	benchmarkSema(b, false, false)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 05 14:59:31 UTC 2019
    - 1.3K bytes
    - Viewed (0)
  3. src/sync/export_test.go

    // 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
    	PopHead() (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)
  4. src/sync/runtime.go

    // library and should not be used directly.
    // If handoff is true, pass count directly to the first waiter.
    // skipframes is the number of frames to omit during tracing, counting from
    // runtime_Semrelease's caller.
    func runtime_Semrelease(s *uint32, handoff bool, skipframes int)
    
    // See runtime/sema.go for documentation.
    func runtime_notifyListAdd(l *notifyList) uint32
    
    // See runtime/sema.go for documentation.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 16 16:32:27 UTC 2022
    - 2.3K bytes
    - Viewed (0)
  5. src/sync/rwmutex.go

    		race.Enable()
    		fatal("sync: RUnlock of unlocked RWMutex")
    	}
    	// A writer is pending.
    	if rw.readerWait.Add(-1) == 0 {
    		// The last reader unblocks the writer.
    		runtime_Semrelease(&rw.writerSem, false, 1)
    	}
    }
    
    // Lock locks rw for writing.
    // If the lock is already locked for reading or writing,
    // Lock blocks until the lock is available.
    func (rw *RWMutex) Lock() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 21:14:51 UTC 2024
    - 7.2K bytes
    - Viewed (0)
  6. src/sync/mutex.go

    				return
    			}
    			// Grab the right to wake someone.
    			new = (old - 1<<mutexWaiterShift) | mutexWoken
    			if atomic.CompareAndSwapInt32(&m.state, old, new) {
    				runtime_Semrelease(&m.sema, false, 1)
    				return
    			}
    			old = m.state
    		}
    	} else {
    		// Starving mode: handoff mutex ownership to the next waiter, and yield
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 21:14:51 UTC 2024
    - 8.4K bytes
    - Viewed (0)
  7. src/sync/waitgroup.go

    	if wg.state.Load() != state {
    		panic("sync: WaitGroup misuse: Add called concurrently with Wait")
    	}
    	// Reset waiters count to 0.
    	wg.state.Store(0)
    	for ; w != 0; w-- {
    		runtime_Semrelease(&wg.sema, false, 0)
    	}
    }
    
    // Done decrements the [WaitGroup] counter by one.
    func (wg *WaitGroup) Done() {
    	wg.Add(-1)
    }
    
    // Wait blocks until the [WaitGroup] counter is zero.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 21:14:51 UTC 2024
    - 4K bytes
    - Viewed (0)
  8. src/sync/mutex_test.go

    	"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++ {
    		go HammerSemaphore(s, 1000, c)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jun 16 21:25:35 UTC 2022
    - 5.9K bytes
    - Viewed (0)
  9. src/runtime/sema.go

    //   - gvisor.dev/gvisor
    //   - github.com/sagernet/gvisor
    //
    // Do not remove or change the type signature.
    // See go.dev/issue/67401.
    //
    //go:linkname sync_runtime_Semrelease sync.runtime_Semrelease
    func sync_runtime_Semrelease(addr *uint32, handoff bool, skipframes int) {
    	semrelease1(addr, handoff, skipframes)
    }
    
    //go:linkname sync_runtime_SemacquireMutex sync.runtime_SemacquireMutex
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 19K bytes
    - Viewed (0)
  10. src/internal/poll/fd_unix.go

    	// Poller may want to unregister fd in readiness notification mechanism,
    	// so this must be executed before CloseFunc.
    	fd.pd.close()
    
    	err := fd.SysFile.destroy(fd.Sysfd)
    
    	fd.Sysfd = -1
    	runtime_Semrelease(&fd.csema)
    	return err
    }
    
    // Close closes the FD. The underlying file descriptor is closed by the
    // destroy method when there are no remaining references.
    func (fd *FD) Close() error {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 31 04:09:44 UTC 2024
    - 17.9K bytes
    - Viewed (0)
Back to top