Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 1,230 for unlock2 (0.29 sec)

  1. src/cmd/go/internal/lockedfile/lockedfile_test.go

    		t.Logf("unlock2()")
    		unlock2()
    	})
    
    	t.Logf("unlock()")
    	unlock()
    	wait(t)
    }
    
    func TestReadWaitsForLock(t *testing.T) {
    	t.Parallel()
    
    	dir, remove := mustTempDir(t)
    	defer remove()
    
    	path := filepath.Join(dir, "timestamp.txt")
    
    	f, err := lockedfile.Create(path)
    	if err != nil {
    		t.Fatalf("Create: %v", err)
    	}
    	defer f.Close()
    
    	const (
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 05 23:35:29 UTC 2023
    - 5.7K bytes
    - Viewed (0)
  2. src/sync/mutex_test.go

    		},
    	},
    	{
    		"Mutex.Unlock2",
    		func() {
    			var mu Mutex
    			mu.Lock()
    			mu.Unlock()
    			mu.Unlock()
    		},
    	},
    	{
    		"RWMutex.Unlock",
    		func() {
    			var mu RWMutex
    			mu.Unlock()
    		},
    	},
    	{
    		"RWMutex.Unlock2",
    		func() {
    			var mu RWMutex
    			mu.RLock()
    			mu.Unlock()
    		},
    	},
    	{
    		"RWMutex.Unlock3",
    		func() {
    			var mu RWMutex
    			mu.Lock()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jun 16 21:25:35 UTC 2022
    - 5.9K bytes
    - Viewed (0)
  3. src/runtime/lockrank_off.go

    }
    
    func getLockRank(l *mutex) lockRank {
    	return 0
    }
    
    func lockWithRank(l *mutex, rank lockRank) {
    	lock2(l)
    }
    
    // This function may be called in nosplit context and thus must be nosplit.
    //
    //go:nosplit
    func acquireLockRankAndM(rank lockRank) {
    	acquirem()
    }
    
    func unlockWithRank(l *mutex) {
    	unlock2(l)
    }
    
    // This function may be called in nosplit context and thus must be nosplit.
    //
    //go:nosplit
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 22 14:29:04 UTC 2024
    - 1.2K bytes
    - Viewed (0)
  4. src/runtime/lock_wasip1.go

    	lockWithRank(l, getLockRank(l))
    }
    
    func lock2(l *mutex) {
    	if l.key == mutex_locked {
    		// wasm is single-threaded so we should never
    		// observe this.
    		throw("self deadlock")
    	}
    	gp := getg()
    	if gp.m.locks < 0 {
    		throw("lock count")
    	}
    	gp.m.locks++
    	l.key = mutex_locked
    }
    
    func unlock(l *mutex) {
    	unlockWithRank(l)
    }
    
    func unlock2(l *mutex) {
    	if l.key == mutex_unlocked {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Nov 21 21:02:20 UTC 2023
    - 2K bytes
    - Viewed (0)
  5. src/runtime/lock_futex.go

    			return
    		}
    		wait = mutex_sleeping
    		futexsleep(key32(&l.key), mutex_sleeping, -1)
    	}
    }
    
    func unlock(l *mutex) {
    	unlockWithRank(l)
    }
    
    func unlock2(l *mutex) {
    	v := atomic.Xchg(key32(&l.key), mutex_unlocked)
    	if v == mutex_unlocked {
    		throw("unlock of unlocked lock")
    	}
    	if v == mutex_sleeping {
    		futexwakeup(key32(&l.key), 1)
    	}
    
    	gp := getg()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 17:57:34 UTC 2024
    - 5.4K bytes
    - Viewed (0)
  6. src/runtime/lockrank_on.go

    				gp.m.locksHeldLen--
    				break
    			}
    		}
    		if !found {
    			println(gp.m.procid, ":", l.rank.String(), l.rank, l)
    			throw("unlock without matching lock acquire")
    		}
    		unlock2(l)
    	})
    }
    
    // releaseLockRankAndM releases a rank which is not associated with a mutex
    // lock. To maintain the invariant that an M with m.locks==0 does not hold any
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 22 14:29:04 UTC 2024
    - 10.6K bytes
    - Viewed (0)
  7. src/runtime/metrics_test.go

    func (m *rwmutexWrite) Unlock1() { m.mu.Unlock() }
    func (m *rwmutexWrite) Lock2()   { m.mu.Lock() }
    func (m *rwmutexWrite) Unlock2() { m.mu.Unlock() }
    
    type rwmutexReadWrite struct {
    	mu sync.RWMutex
    }
    
    func (m *rwmutexReadWrite) Lock1()   { m.mu.RLock() }
    func (m *rwmutexReadWrite) Unlock1() { m.mu.RUnlock() }
    func (m *rwmutexReadWrite) Lock2()   { m.mu.Lock() }
    func (m *rwmutexReadWrite) Unlock2() { m.mu.Unlock() }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 17:52:17 UTC 2024
    - 45K bytes
    - Viewed (0)
  8. src/runtime/lock_sema.go

    					continue Loop
    				}
    			}
    			if v&locked != 0 {
    				// Queued. Wait.
    				semasleep(-1)
    				i = 0
    			}
    		}
    	}
    }
    
    func unlock(l *mutex) {
    	unlockWithRank(l)
    }
    
    // We might not be holding a p in this code.
    //
    //go:nowritebarrier
    func unlock2(l *mutex) {
    	gp := getg()
    	var mp *m
    	for {
    		v := atomic.Loaduintptr(&l.key)
    		if v == locked {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 17:57:37 UTC 2024
    - 6.8K bytes
    - Viewed (0)
  9. src/runtime/lock_js.go

    	lockWithRank(l, getLockRank(l))
    }
    
    func lock2(l *mutex) {
    	if l.key == mutex_locked {
    		// js/wasm is single-threaded so we should never
    		// observe this.
    		throw("self deadlock")
    	}
    	gp := getg()
    	if gp.m.locks < 0 {
    		throw("lock count")
    	}
    	gp.m.locks++
    	l.key = mutex_locked
    }
    
    func unlock(l *mutex) {
    	unlockWithRank(l)
    }
    
    func unlock2(l *mutex) {
    	if l.key == mutex_unlocked {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Nov 21 21:02:20 UTC 2023
    - 7.3K bytes
    - Viewed (0)
  10. src/runtime/mprof.go

    // into the profile.
    //
    // The M will collect the call stack when it unlocks the contended lock. That
    // minimizes the impact on the critical section of the contended lock, and
    // matches the mutex profile's behavior for contention in sync.Mutex: measured
    // at the Unlock method.
    //
    // The profile for contention on sync.Mutex blames the caller of Unlock for the
    // amount of contention experienced by the callers of Lock which had to wait.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 17:57:37 UTC 2024
    - 53.3K bytes
    - Viewed (0)
Back to top