Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 938 for rwmutex (0.32 sec)

  1. src/sync/rwmutex.go

    // not locked for writing on entry to Unlock.
    //
    // As with Mutexes, a locked [RWMutex] is not associated with a particular
    // goroutine. One goroutine may [RWMutex.RLock] ([RWMutex.Lock]) a RWMutex and then
    // arrange for another goroutine to [RWMutex.RUnlock] ([RWMutex.Unlock]) it.
    func (rw *RWMutex) Unlock() {
    	if race.Enabled {
    		_ = rw.w.state
    		race.Release(unsafe.Pointer(&rw.readerSem))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 21:14:51 UTC 2024
    - 7.2K bytes
    - Viewed (0)
  2. src/runtime/rwmutex.go

    )
    
    // This is a copy of sync/rwmutex.go rewritten to work in the runtime.
    
    // A rwmutex is a reader/writer mutual exclusion lock.
    // The lock can be held by an arbitrary number of readers or a single writer.
    // This is a variant of sync.RWMutex, for the runtime package.
    // Like mutex, rwmutex blocks the calling M.
    // It does not interact with the goroutine scheduler.
    type rwmutex struct {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 22 14:29:04 UTC 2024
    - 5K bytes
    - Viewed (0)
  3. test/inline_sync.go

    }
    
    var rwmutex *sync.RWMutex
    
    func small8() { // ERROR "can inline small8"
    	// the RUnlock fast path should be inlined
    	rwmutex.RUnlock() // ERROR "inlining call to sync\.\(\*RWMutex\)\.RUnlock" "inlining call to atomic\.\(\*Int32\)\.Add"
    }
    
    func small9() { // ERROR "can inline small9"
    	// the RLock fast path should be inlined
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 06 21:01:50 UTC 2023
    - 1.6K bytes
    - Viewed (0)
  4. src/sync/rwmutex_test.go

    		<-cdone
    	}
    }
    
    func TestRWMutex(t *testing.T) {
    	var m RWMutex
    
    	m.Lock()
    	if m.TryLock() {
    		t.Fatalf("TryLock succeeded with mutex locked")
    	}
    	if m.TryRLock() {
    		t.Fatalf("TryRLock succeeded with mutex locked")
    	}
    	m.Unlock()
    
    	if !m.TryLock() {
    		t.Fatalf("TryLock failed with mutex unlocked")
    	}
    	m.Unlock()
    
    	if !m.TryRLock() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 29 17:13:13 UTC 2021
    - 4.9K bytes
    - Viewed (0)
  5. src/sync/mutex_test.go

    		},
    	},
    	{
    		"RWMutex.Unlock3",
    		func() {
    			var mu RWMutex
    			mu.Lock()
    			mu.Unlock()
    			mu.Unlock()
    		},
    	},
    	{
    		"RWMutex.RUnlock",
    		func() {
    			var mu RWMutex
    			mu.RUnlock()
    		},
    	},
    	{
    		"RWMutex.RUnlock2",
    		func() {
    			var mu RWMutex
    			mu.Lock()
    			mu.RUnlock()
    		},
    	},
    	{
    		"RWMutex.RUnlock3",
    		func() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jun 16 21:25:35 UTC 2022
    - 5.9K bytes
    - Viewed (0)
  6. src/runtime/race/testdata/rwmutex_test.go

    func TestRaceMutexRWMutex(t *testing.T) {
    	var mu1 sync.Mutex
    	var mu2 sync.RWMutex
    	var x int16 = 0
    	_ = x
    	ch := make(chan bool, 2)
    	go func() {
    		mu1.Lock()
    		defer mu1.Unlock()
    		x = 1
    		ch <- true
    	}()
    	go func() {
    		mu2.Lock()
    		x = 2
    		mu2.Unlock()
    		ch <- true
    	}()
    	<-ch
    	<-ch
    }
    
    func TestNoRaceRWMutex(t *testing.T) {
    	var mu sync.RWMutex
    	var x, y int64 = 0, 1
    	_ = y
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 03 22:09:38 UTC 2017
    - 2.1K bytes
    - Viewed (0)
  7. src/runtime/rwmutex_test.go

    // GOMAXPROCS=10 go test
    
    // This is a copy of sync/rwmutex_test.go rewritten to test the
    // runtime rwmutex.
    
    package runtime_test
    
    import (
    	"fmt"
    	. "runtime"
    	"runtime/debug"
    	"sync/atomic"
    	"testing"
    )
    
    func parallelReader(m *RWMutex, clocked chan bool, cunlock *atomic.Bool, cdone chan bool) {
    	m.RLock()
    	clocked <- true
    	for !cunlock.Load() {
    	}
    	m.RUnlock()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 15 22:00:45 UTC 2023
    - 4.2K bytes
    - Viewed (0)
  8. pkg/scheduler/util/assumecache/assume_cache.go

    	c.rwMutex.RLock()
    	defer c.rwMutex.RUnlock()
    
    	objInfo, err := c.getObjInfo(key)
    	if err != nil {
    		return nil, err
    	}
    	return objInfo.latestObj, nil
    }
    
    // GetAPIObj gets the informer cache's version by its key.
    func (c *AssumeCache) GetAPIObj(key string) (interface{}, error) {
    	c.rwMutex.RLock()
    	defer c.rwMutex.RUnlock()
    
    	objInfo, err := c.getObjInfo(key)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Apr 25 09:46:58 UTC 2024
    - 10.6K bytes
    - Viewed (0)
  9. operator/pkg/cache/cache_test.go

    						}, nil, nil),
    					},
    					Mu: &sync.RWMutex{},
    				},
    			},
    			objCacheRemovalKey: "cache-foo-key",
    			removalKey:         "obj-foo-key",
    			expectedCache: ObjectCache{
    				Cache: map[string]*object.K8sObject{
    					"dont-touch-me-key": object.NewK8sObject(&unstructured.Unstructured{
    						Object: make(map[string]any),
    					}, nil, nil),
    				},
    				Mu: &sync.RWMutex{},
    			},
    		},
    	}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Jan 20 18:46:12 UTC 2023
    - 5.3K bytes
    - Viewed (0)
  10. cmd/namespace-lock.go

    func newNSLock(isDistErasure bool) *nsLockMap {
    	nsMutex := nsLockMap{
    		isDistErasure: isDistErasure,
    	}
    	if isDistErasure {
    		return &nsMutex
    	}
    	nsMutex.lockMap = make(map[string]*nsLock)
    	return &nsMutex
    }
    
    // nsLock - provides primitives for locking critical namespace regions.
    type nsLock struct {
    	ref int32
    	*lsync.LRWMutex
    }
    
    // nsLockMap - namespace lock map, provides primitives to Lock,
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Mon Jun 05 23:56:35 UTC 2023
    - 9.2K bytes
    - Viewed (0)
Back to top