MCPcopy Index your code
hub / github.com/aiprodcoder/MIXAPI / getChannelPollingLock

Function getChannelPollingLock

model/channel.go:495–503  ·  view source on GitHub ↗

getChannelPollingLock returns or creates a mutex for the given channel ID

(channelId int)

Source from the content-addressed store, hash-verified

493
494// getChannelPollingLock returns or creates a mutex for the given channel ID
495func getChannelPollingLock(channelId int) *sync.Mutex {
496 if lock, exists := channelPollingLocks.Load(channelId); exists {
497 return lock.(*sync.Mutex)
498 }
499 // Create new lock for this channel
500 newLock := &sync.Mutex{}
501 actual, _ := channelPollingLocks.LoadOrStore(channelId, newLock)
502 return actual.(*sync.Mutex)
503}
504
505// CleanupChannelPollingLocks removes locks for channels that no longer exist
506// This is optional and can be called periodically to prevent memory leaks

Callers 1

GetNextEnabledKeyMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected