Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 80 for acquire (0.2 sec)

  1. internal/dsync/drwmutex.go

    	quorumLocked := checkQuorumLocked(locks, quorum) && locksFailed <= tolerance
    	if !quorumLocked {
    		log("dsync: Unable to acquire lock in quorum %#v\n", args)
    		// Release all acquired locks without quorum.
    		if !releaseAll(ctx, ds, tolerance, owner, locks, isReadLock, restClnts, names...) {
    			log("Unable to release acquired locks, these locks will expire automatically %#v\n", args)
    		}
    	}
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Feb 22 06:26:06 GMT 2024
    - 19.7K bytes
    - Viewed (0)
  2. internal/lsync/lrwmutex_test.go

    	lrwm := NewLRWMutex()
    
    	if !lrwm.GetRLock(ctx, "", "object1", time.Second) {
    		panic("Failed to acquire read lock")
    	}
    	// fmt.Println("1st read lock acquired, waiting...")
    
    	if !lrwm.GetRLock(ctx, "", "object1", time.Second) {
    		panic("Failed to acquire read lock")
    	}
    	// fmt.Println("2nd read lock acquired, waiting...")
    
    	go func() {
    		time.Sleep(2 * time.Second)
    		lrwm.RUnlock()
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sun Mar 05 04:57:35 GMT 2023
    - 7.9K bytes
    - Viewed (0)
  3. internal/dsync/drwmutex_test.go

    		panic("Failed to acquire read lock")
    	}
    	// fmt.Println("1st read lock acquired, waiting...")
    
    	drwm2 := NewDRWMutex(ds, "simplelock")
    	ctx2, cancel2 := context.WithCancel(context.Background())
    	if !drwm2.GetRLock(ctx2, cancel2, id, source, Options{Timeout: time.Second}) {
    		panic("Failed to acquire read lock")
    	}
    	// fmt.Println("2nd read lock acquired, waiting...")
    
    	go func() {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sat Dec 24 03:49:07 GMT 2022
    - 9.7K bytes
    - Viewed (0)
  4. cmd/namespace-lock_test.go

    		// 3) lk3 or lk4 (whichever didn't execute in step 1) then executes and creates
    		//    a new entry in lockMap and acquires a lock for the same resource.
    
    		<-lk2ch
    		lk3ok := <-lk3ch
    		lk4ok := <-lk4ch
    
    		if lk3ok && lk4ok {
    			t.Fatalf("multiple locks acquired; iteration=%d, lk3=%t, lk4=%t", i, lk3ok, lk4ok)
    		}
    	}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Apr 23 18:58:53 GMT 2021
    - 3.1K bytes
    - Viewed (0)
  5. internal/lock/lock_solaris.go

    // it is similar to LockedOpenFile with with syscall.LOCK_EX
    // mode but along with syscall.LOCK_NB such that the function
    // doesn't wait forever but instead returns if it cannot
    // acquire a write lock.
    func TryLockedOpenFile(path string, flag int, perm os.FileMode) (*LockedFile, error) {
    	return lockedOpenFile(path, flag, perm, syscall.F_SETLK)
    }
    
    // LockedOpenFile - initializes a new lock and protects
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sun Jan 02 17:15:06 GMT 2022
    - 2.8K bytes
    - Viewed (0)
  6. cmd/callhome.go

    		return
    	}
    
    	go func() {
    		r := rand.New(rand.NewSource(time.Now().UnixNano()))
    		// Leader node (that successfully acquires the lock inside runCallhome)
    		// will keep performing the callhome. If the leader goes down for some reason,
    		// the lock will be released and another node will acquire it and take over
    		// because of this loop.
    		for {
    			if !globalCallhomeConfig.Enabled() {
    				return
    			}
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 5.1K bytes
    - Viewed (1)
  7. internal/dsync/dsync_test.go

    	for i := 0; i < len(nodes); i++ {
    		clnts = append(clnts, newClient(nodes[i].URL))
    	}
    
    	ds = &Dsync{
    		GetLockers: func() ([]NetLocker, string) { return clnts, uuid.New().String() },
    		Timeouts: Timeouts{
    			Acquire:         testDrwMutexAcquireTimeout,
    			RefreshCall:     testDrwMutexRefreshCallTimeout,
    			UnlockCall:      testDrwMutexUnlockCallTimeout,
    			ForceUnlockCall: testDrwMutexForceUnlockCallTimeout,
    		},
    	}
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sat Dec 24 03:49:07 GMT 2022
    - 11K bytes
    - Viewed (0)
  8. cmd/license-update.go

    	go func() {
    		r := rand.New(rand.NewSource(time.Now().UnixNano()))
    		// Leader node (that successfully acquires the lock inside licenceUpdaterLoop)
    		// will keep performing the license update. If the leader goes down for some
    		// reason, the lock will be released and another node will acquire it and
    		// take over because of this loop.
    		for {
    			licenceUpdaterLoop(ctx, objAPI)
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 3.3K bytes
    - Viewed (0)
  9. internal/lock/lock_nix.go

    // it is similar to LockedOpenFile with with syscall.LOCK_EX
    // mode but along with syscall.LOCK_NB such that the function
    // doesn't wait forever but instead returns if it cannot
    // acquire a write lock.
    func TryLockedOpenFile(path string, flag int, perm os.FileMode) (*LockedFile, error) {
    	return lockedOpenFile(path, flag, perm, syscall.LOCK_NB)
    }
    
    // LockedOpenFile - initializes a new lock and protects
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Aug 19 01:35:22 GMT 2021
    - 2.8K bytes
    - Viewed (0)
  10. src/cmd/asm/internal/arch/mips.go

    // one of the CMP instructions that require special handling.
    func IsMIPSCMP(op obj.As) bool {
    	switch op {
    	case mips.ACMPEQF, mips.ACMPEQD, mips.ACMPGEF, mips.ACMPGED,
    		mips.ACMPGTF, mips.ACMPGTD:
    		return true
    	}
    	return false
    }
    
    // IsMIPSMUL reports whether the op (as defined by an mips.A* constant) is
    // one of the MUL/DIV/REM/MADD/MSUB instructions that require special handling.
    func IsMIPSMUL(op obj.As) bool {
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Wed Mar 04 19:06:44 GMT 2020
    - 1.7K bytes
    - Viewed (0)
Back to top