// releaseFlow releases the flow and updates the conntrack table
177157
func (d *Datapath) releaseFlow(context *pucontext.PUContext, report *policy.FlowPolicy, action *policy.FlowPolicy, tcpPacket *packet.Packet) {

	if err := d.appOrigConnectionTracker.Remove(tcpPacket.L4ReverseFlowHash()); err != nil {
		zap.L().Debug("Failed to clean cache appOrigConnectionTracker", zap.Error(err))
	}

	if err := d.sourcePortConnectionCache.Remove(tcpPacket.SourcePortHash(packet.PacketTypeNetwork)); err != nil {
		zap.L().Debug("Failed to clean cache sourcePortConnectionCache", zap.Error(err))
	}

	if err := d.conntrack.UpdateNetworkFlowMark(
		tcpPacket.SourceAddress(),
		tcpPacket.DestinationAddress(),
		tcpPacket.IPProto(),
		tcpPacket.SourcePort(),
		tcpPacket.DestPort(),
		constants.DefaultConnMark,
	); err != nil {
		zap.L().Error("Failed to update conntrack table",
			zap.String("app-conn", tcpPacket.L4ReverseFlowHash()),
			zap.Error(err))
	}

	d.reportReverseExternalServiceFlow(context, report, action, true, tcpPacket)
}
227214
func (s *PostgresStore) Release() error {
	// Skip encoding if the data is empty
	if len(s.data) == 0 {
		return nil
	}

	data, err := session.EncodeGob(s.data)
	if err != nil {
		return err
	}

	_, err = s.c.Exec("UPDATE session SET data=$1, expiry=$2 WHERE key=$3",
		data, time.Now().Unix(), s.sid)
	return err
}
416072
func (v *ebsVolumeSource) ReleaseVolumes(ctx context.ProviderCallContext, volIds []string) ([]error, error) {
	return foreachVolume(v.env.ec2, ctx, volIds, releaseVolume), nil
}
1270768
func (c *collectorImpl) CollectFlowEvent(record *collector.FlowRecord) {

	hash := collector.StatsFlowHash(record)

	// If flow event doesn't have a count make it equal to 1. At least one flow is collected
	if record.Count == 0 {
		record.Count = 1
	}

	c.Lock()
	defer c.Unlock()

	if r, ok := c.Flows[hash]; ok {
		r.Count = r.Count + record.Count
		return
	}

	c.Flows[hash] = record

	c.Flows[hash].Tags = record.Tags
}
632226
func (s *Dynamic) Release() {
	s.mu.Lock()
	defer s.mu.Unlock()

	if s.cur < 1 {
		panic("semaphore: bad release")
	}

	next := s.waiters.Front()

	// If there are no waiters, just decrement and we're done
	if next == nil {
		s.cur--
		return
	}

	// Need to yield our slot to the next waiter.
	// Remove them from the list
	s.waiters.Remove(next)
	// And trigger it's chan before we release the lock
	close(next.Value.(chan struct{}))
	// Note we _don't_ decrement inflight since the slot was yielded directly.
}
691872
func (s *releasesService) Release(ctx context.Context, release *Release, ss twelvefactor.StatusStream) error {
	a, err := newSchedulerApp(release)
	if err != nil {
		return err
	}
	return s.Scheduler.Submit(ctx, a, ss)
}
393091
func (r *Route) Release() {
	if r.ref != nil {
		r.ref.decRef()
		r.ref = nil
	}
}
107247
func (db *memDB) ReleaseName(name string) error {
	return db.withTxn(func(txn *memdb.Txn) error {
		return txn.Delete(memdbNamesTable, nameAssociation{name: name})
	})
}
71589
func (t *connTable) GetByFlow(ck ckey) *Metadata {
	t.mtx.RLock()
	defer t.mtx.RUnlock()
	return t.table[ck]
}
682617
func (s *Session) release() error {
	return s.Wallet.card.Disconnect(pcsc.LeaveCard)
}
731583
func ApplicationFlow(tokenURL string) {
	if parent, ok := dslengine.CurrentDefinition().(*design.SecuritySchemeDefinition); ok {
		if parent.Kind == design.OAuth2SecurityKind {
			parent.Flow = "application"
			parent.TokenURL = tokenURL
			return
		}
	}
	dslengine.IncompatibleDSL()
}
165280
func (w *Wallet) release() error {
	if w.session != nil {
		return w.session.release()
	}
	return nil
}
146546
func (s *Service) ReleaseCreate(ctx context.Context, appIdentity string, o ReleaseCreateOpts) (*Release, error) {
	var release Release
	return &release, s.Post(ctx, &release, fmt.Sprintf("/apps/%v/releases", appIdentity), o)
}
840116
func (b *Buffer) Release() {
	// Increment the version so overlapping operations fail.
	b.postOp(b.preOp())

	if b.pool.testDetectUseAfterFree {
		b.releaseDetectUseAfterFree()
		return
	}

	// Before releasing a buffer, we should reset it to "clear" the buffer
	// while holding on to the capacity of the buffer.
	b.Reset()

	// We must mark released after the `Reset`, so that `Reset` doesn't
	// trigger use-after-free.
	b.released = true

	b.pool.release(b)
}
853265
func (s *VolumeSource) ReleaseVolumes(ctx context.ProviderCallContext, volIds []string) ([]error, error) {
	s.MethodCall(s, "ReleaseVolumes", ctx, volIds)
	if s.ReleaseVolumesFunc != nil {
		return s.ReleaseVolumesFunc(ctx, volIds)
	}
	return nil, errors.NotImplementedf("ReleaseVolumes")
}
726378
func (f *Flow) Close() *Flow {
	f.add(action{
		kind: actionClose,
	})

	return f
}
321079
func (p *Pool) Release(conn *Conn) {
	if conn == nil {
		return
	}
	p.mutex.Lock()
	defer p.mutex.Unlock()
	if p.closed {
		return
	}
	go p.pushBack(conn)
}