Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 510 for clocked (0.22 sec)

  1. internal/lsync/lrwmutex_test.go

    	wl := NewLRWMutex()
    	var rl sync.Locker
    	wlocked := make(chan bool, 1)
    	rlocked := make(chan bool, 1)
    	rl = wl.DRLocker()
    	n := 10
    	go func() {
    		for i := 0; i < n; i++ {
    			rl.Lock()
    			rl.Lock()
    			rlocked <- true
    			wl.Lock()
    			wlocked <- true
    		}
    	}()
    	for i := 0; i < n; i++ {
    		<-rlocked
    		rl.Unlock()
    		select {
    		case <-wlocked:
    			t.Fatal("RLocker() didn't read-lock it")
    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)
  2. internal/dsync/drwmutex_test.go

    	expected := true
    	if locked != expected {
    		t.Errorf("TestSimpleWriteLockAcquired(): \nexpected %#v\ngot      %#v", expected, locked)
    	}
    }
    
    func TestSimpleWriteLockTimedOut(t *testing.T) {
    	locked := testSimpleWriteLock(t, testDrwMutexAcquireTimeout)
    
    	expected := false
    	if locked != expected {
    		t.Errorf("TestSimpleWriteLockTimedOut(): \nexpected %#v\ngot      %#v", expected, locked)
    	}
    }
    
    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)
  3. internal/lock/lock_test.go

    			return
    		}
    		locked <- struct{}{}
    		if blerr = bl.Close(); blerr != nil {
    			t.Error(blerr)
    			return
    		}
    	}()
    
    	select {
    	case <-locked:
    		t.Error("unexpected unblocking")
    	case <-time.After(100 * time.Millisecond):
    	}
    
    	// unlock
    	if err = dupl.Close(); err != nil {
    		t.Fatal(err)
    	}
    
    	// the previously blocked routine should be unblocked
    	select {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Sep 19 18:05:16 GMT 2022
    - 3.6K bytes
    - Viewed (0)
  4. internal/dsync/drwmutex.go

    }
    
    // Granted - represents a structure of a granted lock.
    type Granted struct {
    	index   int
    	lockUID string // Locked if set with UID string, unlocked if empty
    }
    
    func (g *Granted) isLocked() bool {
    	return isLocked(g.lockUID)
    }
    
    func isLocked(uid string) bool {
    	return len(uid) > 0
    }
    
    // NewDRWMutex - initializes a new dsync RW mutex.
    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)
  5. internal/dsync/locker.go

    	// In that case, the resource may or may not be unlocked.
    	RUnlock(ctx context.Context, args LockArgs) (bool, error)
    
    	// Do write unlock for given LockArgs. It should return
    	// * a boolean to indicate success/failure of the operation
    	// * an error on failure of unlock request operation.
    	// Canceling the context will abort the remote call.
    	// In that case, the resource may or may not be unlocked.
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Jan 18 20:44:38 GMT 2022
    - 2.7K bytes
    - Viewed (0)
  6. internal/lsync/lrwmutex.go

    			lm.ref = 1
    			lm.isWriteLock = true
    			locked = true
    		}
    	} else {
    		if !lm.isWriteLock {
    			lm.ref++
    			locked = true
    		}
    	}
    
    	return locked
    }
    
    const (
    	lockRetryInterval = 50 * time.Millisecond
    )
    
    // lockLoop will acquire either a read or a write lock
    //
    // The call will block until the lock is granted using a built-in
    // timing randomized back-off algorithm to try again until successful
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sun Jan 02 17:15:06 GMT 2022
    - 4.8K bytes
    - Viewed (0)
  7. cmd/local-locker_test.go

    	}
    	// A UID is added for every resource.
    	// We removed Add Rlocked entries
    	if len(l.lockUID) != len(wResources)*m {
    		t.Fatalf("lockUID len, got %d, want %d + %d", len(l.lockUID), 0, len(wResources)*m)
    	}
    
    	// Remove write locked
    	for i, names := range wResources {
    		arg := dsync.LockArgs{
    			UID:       wUIDs[i],
    			Resources: names[:],
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sun Mar 05 04:57:35 GMT 2023
    - 11.8K bytes
    - Viewed (0)
  8. cmd/local-locker.go

    	}
    	return lockCopy
    }
    
    func (l *localLocker) Close() error {
    	return nil
    }
    
    // IsOnline - local locker is always online.
    func (l *localLocker) IsOnline() bool {
    	return true
    }
    
    // IsLocal - local locker returns true.
    func (l *localLocker) IsLocal() bool {
    	return true
    }
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Feb 19 22:54:46 GMT 2024
    - 10.6K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/util/concurrent/InterruptibleTaskTest.java

        // after some period of time the runner thread should become blocked on the task because it is
        // waiting for the slow interrupting thread to complete Thread.interrupt
        awaitBlockedOnInstanceOf(runner, InterruptibleTask.Blocker.class);
    
        Blocker blocker = (Blocker) LockSupport.getBlocker(runner);
        Thread owner = blocker.getOwner();
        assertThat(owner).isSameInstanceAs(interrupter);
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 6.6K bytes
    - Viewed (0)
  10. internal/lock/lock.go

    // open file descriptor.
    package lock
    
    import (
    	"errors"
    	"os"
    	"sync"
    )
    
    // ErrAlreadyLocked is returned if the underlying fd is already locked.
    var ErrAlreadyLocked = errors.New("file already locked")
    
    // RLockedFile represents a read locked file, implements a special
    // closer which only closes the associated *os.File when the ref count.
    // has reached zero, i.e when all the readers have given up their locks.
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sun Jan 02 17:15:06 GMT 2022
    - 2.5K bytes
    - Viewed (0)
Back to top