// unlock unlocks the sandbox to allow it being accessed by other processes.
966396
func unlockSandbox(lockFile *os.File) error {
	if lockFile == nil {
		return fmt.Errorf("lockFile cannot be empty")
	}

	err := syscall.Flock(int(lockFile.Fd()), syscall.LOCK_UN)
	if err != nil {
		return err
	}

	lockFile.Close()

	return nil
}
400907
func (rw LeveledRWMutex) Unlock(lockState *LockState) {
	err := lockState.doUnlock(rw.level, writeExclusion, rw.rwLocker)
	if err != nil {
		panic(err)
	}
}
513835
func (c *RemoteClient) unlock(id string) error {
	// this doesn't use the lock id, because the lock is tied to the consul client.
	if c.consulLock == nil || c.lockCh == nil {
		return nil
	}

	// cancel our monitoring goroutine
	c.monitorCancel()

	defer func() {
		c.consulLock = nil

		// The consul session is only used for this single lock, so cancel it
		// after we unlock.
		// The session is only created and replaced holding Client.mu, so the
		// CancelFunc must be non-nil.
		c.sessionCancel()
	}()

	select {
	case <-c.lockCh:
		return lostLockErr
	default:
	}

	kv := c.Client.KV()

	var errs error

	if _, err := kv.Delete(c.Path+lockInfoSuffix, nil); err != nil {
		errs = multierror.Append(errs, err)
	}

	if err := c.consulLock.Unlock(); err != nil {
		errs = multierror.Append(errs, err)
	}

	// the monitoring goroutine may be in a select on the lockCh, so we need to
	// wait for it to return before changing the value.
	c.monitorWG.Wait()
	c.lockCh = nil

	// This is only cleanup, and will fail if the lock was immediately taken by
	// another client, so we don't report an error to the user here.
	c.consulLock.Destroy()

	return errs
}
493731
func (ld *memoryTopoLockDescriptor) Unlock(ctx context.Context) error {
	return ld.c.unlock(ctx, ld.dirPath)
}
433797
func unlockPath(fileHandles []uintptr) {
	if fileHandles != nil {
		for _, handle := range fileHandles {
			syscall.CloseHandle(syscall.Handle(handle))
		}
	}
}
341434
func (obj *Field) Unlock(ctx context.Context) (bool, error) {
	result := &struct {
		Return bool	`json:"qReturn"`
	} {}
	err := obj.rpc(ctx, "Unlock", result)
	return result.Return, err 
}
898481
func (cs *StreamManager) UnlockProtectedEntry(e *Entry) {
	for i := range e.Values {
		if bool(e.Values[i].Value.Protected) {
			e.Values[i].Value.Content = string(cs.Unpack(e.Values[i].Value.Content))
		}
	}
	for i := range e.Histories {
		cs.UnlockProtectedEntries(e.Histories[i].Entries)
	}
}
730113
func (m *MutexKV) Lock(key string) {
	log.Printf("[DEBUG] Locking %q", key)
	m.get(key).Lock()
	log.Printf("[DEBUG] Locked %q", key)
}
1364436
func (nm *NamedMutex) Unlock(name string) {
	nm.localMutex.Lock()
	defer nm.localMutex.Unlock()
	mc := nm.mutexMap[name]
	if len(mc) == 0 {
		panic("No named mutex acquired: " + name)
	}
	<-mc
}
1207522
func (l *AdvisoryLock) Unlock() error {
	l.mu.Lock()
	defer l.mu.Unlock()

	if l.commited {
		panic("unlock called on commited lock")
	}

	if l.c == 0 {
		panic("unlock of unlocked advisory lock")
	}

	_, err := l.tx.Exec(fmt.Sprintf("SELECT pg_advisory_unlock($1) /* %s */", l.Context), l.key)
	if err != nil {
		return err
	}

	l.c -= 1

	if l.c == 0 {
		if err := l.commit(); err != nil {
			return err
		}
	}

	return err
}
1072162
func (f *Facade) unlockTenant(ctx datastore.Context, tenantID string) (err error) {
	defer ctx.Metrics().Stop(ctx.Metrics().Start("Facade.unlockTenant"))
	mutex := getTenantLock(tenantID)
	var svcs []service.ServiceDetails
	if svcs, err = f.GetServiceDetailsByTenantID(ctx, tenantID); err != nil {
		glog.Errorf("Could not get services for tenant %s: %s", tenantID, err)
		return
	}
	if err = f.zzk.UnlockServices(ctx, svcs); err != nil {
		glog.Errorf("Could not unlock services for tenant %s: %s", tenantID, err)
		return
	}
	mutex.Unlock()
	return
}
836799
func (ctx CUContext) Unlock() error {
	if err := Synchronize(); err != nil {
		return err
	}
	runtime.UnlockOSThread()
	return nil
}
457871
func (ks *KeyStore) Lock(addr common.Address) error {
	ks.mu.Lock()
	if unl, found := ks.unlocked[addr]; found {
		ks.mu.Unlock()
		ks.expire(addr, unl, time.Duration(0)*time.Nanosecond)
	} else {
		ks.mu.Unlock()
	}
	return nil
}
1037188
func (s *Filesystem) Unlock(id string) error {
	defer s.mutex()()

	if s.lockID == "" {
		return fmt.Errorf("LocalState not locked")
	}

	if id != s.lockID {
		idErr := fmt.Errorf("invalid lock id: %q. current id: %q", id, s.lockID)
		info, err := s.lockInfo()
		if err != nil {
			err = multierror.Append(idErr, err)
		}

		return &LockError{
			Err:  idErr,
			Info: info,
		}
	}

	lockInfoPath := s.lockInfoPath()
	log.Printf("[TRACE] statemgr.Filesystem: removing lock metadata file %s", lockInfoPath)
	os.Remove(lockInfoPath)

	fileName := s.stateFileOut.Name()

	unlockErr := s.unlock()

	s.stateFileOut.Close()
	s.stateFileOut = nil
	s.lockID = ""

	// clean up the state file if we created it an never wrote to it
	stat, err := os.Stat(fileName)
	if err == nil && stat.Size() == 0 && s.created {
		os.Remove(fileName)
	}

	return unlockErr
}
217644
func unlockpt(f *os.File) error {
	var u int32
	return ioctl(f.Fd(), unix.TIOCPTYUNLK, uintptr(unsafe.Pointer(&u)))
}
1239551
func (client *lockRESTClient) Unlock(args dsync.LockArgs) (reply bool, err error) {
	return client.restCall(lockRESTMethodUnlock, args)
}
938625
func (m LeveledMutex) Unlock(lockState *LockState) {
	err := lockState.doUnlock(m.level, writeExclusion, m.locker)
	if err != nil {
		panic(err)
	}
}