mirror of
https://github.com/lordmathis/llamactl.git
synced 2025-11-06 00:54:23 +00:00
Remove locks from SetStatus
This commit is contained in:
@@ -27,15 +27,11 @@ var statusToName = map[InstanceStatus]string{
|
||||
}
|
||||
|
||||
func (p *Process) SetStatus(status InstanceStatus) {
|
||||
p.mu.Lock()
|
||||
oldStatus := p.Status
|
||||
p.Status = status
|
||||
callback := p.onStatusChange // Capture callback reference
|
||||
p.mu.Unlock()
|
||||
|
||||
// Call callback outside the lock to prevent deadlocks
|
||||
if callback != nil {
|
||||
callback(oldStatus, status)
|
||||
if p.onStatusChange != nil {
|
||||
p.onStatusChange(oldStatus, status)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user