mirror of
https://github.com/lordmathis/llamactl.git
synced 2025-11-06 00:54:23 +00:00
Remove unnecessary read locks from GetStatus and IsRunning methods
This commit is contained in:
@@ -36,15 +36,11 @@ func (p *Process) SetStatus(status InstanceStatus) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *Process) GetStatus() InstanceStatus {
|
func (p *Process) GetStatus() InstanceStatus {
|
||||||
p.mu.RLock()
|
|
||||||
defer p.mu.RUnlock()
|
|
||||||
return p.Status
|
return p.Status
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsRunning returns true if the status is Running
|
// IsRunning returns true if the status is Running
|
||||||
func (p *Process) IsRunning() bool {
|
func (p *Process) IsRunning() bool {
|
||||||
p.mu.RLock()
|
|
||||||
defer p.mu.RUnlock()
|
|
||||||
return p.Status == Running
|
return p.Status == Running
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user