// release frees the use of the number for another allocation
181679
func (a *allocator) release(n int) {
	a.pool.SetBit(a.pool, n-a.low, free)
}
794477
func (p *EOSClient) Release() error {
	eosError := C.EdsTerminateSDK()
	if eosError != C.EDS_ERR_OK {
		return errors.New("Error when terminating Canon SDK")
	}
	return nil
}
707579
func (b *Buffer) Release() error {
	if b == nil || b.C_gss_buffer_t == nil {
		return nil
	}

	defer func() {
		C.free(unsafe.Pointer(b.C_gss_buffer_t))
		b.C_gss_buffer_t = nil
		b.alloc = allocNone
	}()

	// free the value as needed
	switch {
	case b.C_gss_buffer_t.value == nil:
		// do nothing

	case b.alloc == allocMalloc:
		C.free(b.C_gss_buffer_t.value)

	case b.alloc == allocGSSAPI:
		var min C.OM_uint32
		maj := C.wrap_gss_release_buffer(b.Fp_gss_release_buffer, &min, b.C_gss_buffer_t)
		err := b.stashLastStatus(maj, min)
		if err != nil {
			return err
		}
	}

	return nil
}
697976
func (mount *MountInfo) Release() error {
	ret := C.ceph_release(mount.mount)
	if ret != 0 {
		log.Errorf("Release: Failed to release mount")
		return cephError(ret)
	}
	return nil
}
115852
func (s *State) Release() {
	s.dbCond.L.Lock()
	defer s.dbCond.L.Unlock()
	s.dbUsers--
	if s.dbUsers == 0 {
		s.dbCond.Broadcast()
	}
}
600835
func (snap *dbCacheSnapshot) Release() {
	snap.dbSnapshot.Release()
	snap.pendingKeys = nil
	snap.pendingRemove = nil
}
704213
func (d Delivery) Release(delivered bool) {
	if delivered {
		d.SettleAs(Modified)
	} else {
		d.SettleAs(Released)
	}
}
118887
func (s *Semaphore) Release() {
	s.rMutex.Lock()
	defer s.rMutex.Unlock()

	s.channel <- struct{}{}

	s.pMutex.Lock()
	s.avail++
	s.pMutex.Unlock()
}
803219
func (a *IPRangeAllocator) Release(ip net.IP) {
	a.mutex.Lock()
	defer a.mutex.Unlock()

	// calculate the idx from the start
	ipBig := big.NewInt(0)
	ipBig.SetBytes(ip)
	idx := ipBig.Sub(ipBig, a.startBig).Int64()

	// check if the idx is reserved
	if a.reserved[idx] {
		delete(a.reserved, idx)
		a.remaining++
	}
}
51160
func (c *DefaultPlanner) Release(groups []CompactionGroup) {
	c.mu.Lock()
	defer c.mu.Unlock()
	for _, g := range groups {
		for _, f := range g {
			delete(c.filesInUse, f)
		}
	}
}
89015
func (v *VirtualIPManager) Release(ipaddr, device string) error {
	logger := plog.WithFields(logrus.Fields{
		"ipaddress": ipaddr,
		"device":    device,
	})

	cmd := exec.Command("ip", "a", "del", ipaddr, "dev", device)
	output, err := cmd.CombinedOutput()
	if err != nil {
		logger.WithError(err).WithFields(logrus.Fields{
			"command": cmd,
			"output":  string(output),
		}).Debug("Could not remove virtual ip")
		return err
	}

	logger.Debug("Removed virtual ip")
	return nil
}
820966
func (ref *Reference) Release() {
	ref.once.Do(func() {
		live.untrack(ref)
		ref.wg.Done()
	})
}
850665
func (c *ServerContext) Release() error {
	if c == nil {
		return nil
	}
	return c.sctxt.Release()
}
402555
func (s *VolumesService) Release(ctx context.Context, name string, ref string) error {
	return s.vs.Release(ctx, name, ref)
}
1188989
func (txl *Impl) Release(immediate *querypb.VTGateCallerID, effective *vtrpcpb.CallerID) {
	key := txl.extractKey(immediate, effective)

	txl.mu.Lock()
	defer txl.mu.Unlock()

	usage, ok := txl.usageMap[key]
	if !ok {
		return
	}
	if usage == 1 {
		delete(txl.usageMap, key)
		return
	}

	txl.usageMap[key] = usage - 1
}
868834
func (b *Bucket) Release(headers http.Header) error {
	defer b.Unlock()

	// Check if the bucket uses a custom ratelimiter
	if rl := b.customRateLimit; rl != nil {
		if time.Now().Sub(b.lastReset) >= rl.reset {
			b.Remaining = rl.requests - 1
			b.lastReset = time.Now()
		}
		if b.Remaining < 1 {
			b.reset = time.Now().Add(rl.reset)
		}
		return nil
	}

	if headers == nil {
		return nil
	}

	remaining := headers.Get("X-RateLimit-Remaining")
	reset := headers.Get("X-RateLimit-Reset")
	global := headers.Get("X-RateLimit-Global")
	retryAfter := headers.Get("Retry-After")

	// Update global and per bucket reset time if the proper headers are available
	// If global is set, then it will block all buckets until after Retry-After
	// If Retry-After without global is provided it will use that for the new reset
	// time since it's more accurate than X-RateLimit-Reset.
	// If Retry-After after is not proided, it will update the reset time from X-RateLimit-Reset
	if retryAfter != "" {
		parsedAfter, err := strconv.ParseInt(retryAfter, 10, 64)
		if err != nil {
			return err
		}

		resetAt := time.Now().Add(time.Duration(parsedAfter) * time.Millisecond)

		// Lock either this single bucket or all buckets
		if global != "" {
			atomic.StoreInt64(b.global, resetAt.UnixNano())
		} else {
			b.reset = resetAt
		}
	} else if reset != "" {
		// Calculate the reset time by using the date header returned from discord
		discordTime, err := http.ParseTime(headers.Get("Date"))
		if err != nil {
			return err
		}

		unix, err := strconv.ParseInt(reset, 10, 64)
		if err != nil {
			return err
		}

		// Calculate the time until reset and add it to the current local time
		// some extra time is added because without it i still encountered 429's.
		// The added amount is the lowest amount that gave no 429's
		// in 1k requests
		delta := time.Unix(unix, 0).Sub(discordTime) + time.Millisecond*250
		b.reset = time.Now().Add(delta)
	}

	// Udpate remaining if header is present
	if remaining != "" {
		parsedRemaining, err := strconv.ParseInt(remaining, 10, 32)
		if err != nil {
			return err
		}
		b.Remaining = int(parsedRemaining)
	}

	return nil
}
311582
func (e *edge) release() {
	if e.releaserCount > 0 {
		e.releaserCount--
		return
	}
	e.index.Release(e)
	if e.result != nil {
		go e.result.Release(context.TODO())
	}
}