Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 35 for WriteLock (0.31 sec)

  1. src/os/file_mutex_plan9.go

    // reference.
    func (file *file) readUnlock() {
    	if file.fdmu.ReadUnlock() {
    		file.destroy()
    	}
    }
    
    // writeLock adds a reference to the file and locks it for writing.
    // It returns an error if the file is already closed.
    func (file *file) writeLock() error {
    	if !file.fdmu.WriteLock() {
    		return ErrClosed
    	}
    	return nil
    }
    
    // writeUnlock removes a reference from the file and unlocks it for writing.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Oct 08 03:57:40 UTC 2022
    - 1.8K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/util/concurrent/CycleDetectingLockFactoryTest.java

      private ReentrantReadWriteLock.ReadLock readLockB;
      private ReentrantReadWriteLock.ReadLock readLockC;
      private ReentrantReadWriteLock.WriteLock writeLockA;
      private ReentrantReadWriteLock.WriteLock writeLockB;
      private ReentrantReadWriteLock.WriteLock writeLockC;
      private ReentrantLock lock1;
      private ReentrantLock lock2;
      private ReentrantLock lock3;
      private ReentrantLock lock01;
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 16.1K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/util/concurrent/CycleDetectingLockFactoryTest.java

      private ReentrantReadWriteLock.ReadLock readLockB;
      private ReentrantReadWriteLock.ReadLock readLockC;
      private ReentrantReadWriteLock.WriteLock writeLockA;
      private ReentrantReadWriteLock.WriteLock writeLockB;
      private ReentrantReadWriteLock.WriteLock writeLockC;
      private ReentrantLock lock1;
      private ReentrantLock lock2;
      private ReentrantLock lock3;
      private ReentrantLock lock01;
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 16.1K bytes
    - Viewed (0)
  4. internal/dsync/dsync-server_test.go

    		subrouter.Methods(http.MethodPost).Path("/v1/force-unlock").HandlerFunc(lockServer.ForceUnlockHandler)
    
    		nodes[i] = httptest.NewServer(router)
    	}
    }
    
    const WriteLock = -1
    
    type lockServer struct {
    	mutex sync.Mutex
    	// Map of locks, with negative value indicating (exclusive) write lock
    	// and positive values indicating number of read locks
    	lockMap map[string]int64
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Mon Jan 23 16:46:37 UTC 2023
    - 8.3K bytes
    - Viewed (0)
  5. src/internal/poll/fd_unix.go

    					continue
    				}
    			}
    		}
    		err = fd.eofError(n, err)
    		return n, oobn, sysflags, err
    	}
    }
    
    // Write implements io.Writer.
    func (fd *FD) Write(p []byte) (int, error) {
    	if err := fd.writeLock(); err != nil {
    		return 0, err
    	}
    	defer fd.writeUnlock()
    	if err := fd.pd.prepareWrite(fd.isFile); err != nil {
    		return 0, err
    	}
    	var nn int
    	for {
    		max := len(p)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 31 04:09:44 UTC 2024
    - 17.9K bytes
    - Viewed (0)
  6. src/cmd/go/internal/lockedfile/internal/filelock/filelock.go

    // unspecified.
    //
    // Closing the file may or may not release the lock promptly. Callers should
    // ensure that Unlock is always called when Lock succeeds.
    func Lock(f File) error {
    	return lock(f, writeLock)
    }
    
    // RLock places an advisory read lock on the file, blocking until it can be locked.
    //
    // If RLock returns nil, no other process will be able to place a write lock on
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 17 02:24:35 UTC 2023
    - 2.6K bytes
    - Viewed (0)
  7. src/cmd/go/internal/lockedfile/internal/filelock/filelock_other.go

    // license that can be found in the LICENSE file.
    
    //go:build !unix && !windows
    
    package filelock
    
    import (
    	"errors"
    	"io/fs"
    )
    
    type lockType int8
    
    const (
    	readLock = iota + 1
    	writeLock
    )
    
    func lock(f File, lt lockType) error {
    	return &fs.PathError{
    		Op:   lt.String(),
    		Path: f.Name(),
    		Err:  errors.ErrUnsupported,
    	}
    }
    
    func unlock(f File) error {
    	return &fs.PathError{
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 17 02:24:35 UTC 2023
    - 563 bytes
    - Viewed (0)
  8. src/cmd/go/internal/lockedfile/internal/filelock/filelock_unix.go

    //go:build darwin || dragonfly || freebsd || illumos || linux || netbsd || openbsd
    
    package filelock
    
    import (
    	"io/fs"
    	"syscall"
    )
    
    type lockType int16
    
    const (
    	readLock  lockType = syscall.LOCK_SH
    	writeLock lockType = syscall.LOCK_EX
    )
    
    func lock(f File, lt lockType) (err error) {
    	for {
    		err = syscall.Flock(int(f.Fd()), int(lt))
    		if err != syscall.EINTR {
    			break
    		}
    	}
    	if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 17 02:24:35 UTC 2023
    - 723 bytes
    - Viewed (0)
  9. src/internal/poll/sendfile_linux.go

    func SendFile(dstFD *FD, src int, remain int64) (written int64, err error, handled bool) {
    	defer func() {
    		TestHookDidSendFile(dstFD, src, written, err, handled)
    	}()
    	if err := dstFD.writeLock(); err != nil {
    		return 0, err, false
    	}
    	defer dstFD.writeUnlock()
    
    	if err := dstFD.pd.prepareWrite(dstFD.isFile); err != nil {
    		return 0, err, false
    	}
    
    	dst := dstFD.Sysfd
    	for remain > 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 18:12:56 UTC 2024
    - 1.4K bytes
    - Viewed (0)
  10. platforms/core-execution/build-cache-local/src/main/java/org/gradle/caching/local/internal/DirectoryBuildCache.java

            persistentCache.withFileLock(() -> {
                // Additional locking necessary because of https://github.com/gradle/gradle/issues/3537
                lock.writeLock().lock();
                try {
                    storeInsideLock(key, file);
                } finally {
                    lock.writeLock().unlock();
                }
            });
        }
    
        private void storeInsideLock(HashCode key, File sourceFile) {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Apr 16 15:49:53 UTC 2024
    - 7K bytes
    - Viewed (0)
Back to top