Fix race conditions and improve lifecycle safety #150

Merged
bagas merged 7 commits from refactor/lifecycle-concurrency-safety into staging 2026-07-16 17:31:15 +07:00
Showing only changes of commit efbff0f7f7 - Show all commits
+4
View File
@@ -73,10 +73,14 @@ func (l *lifecycle) User() string {
} }
func (l *lifecycle) SetChannel(channel ssh.Channel) { func (l *lifecycle) SetChannel(channel ssh.Channel) {
l.mu.Lock()
defer l.mu.Unlock()
l.channel = channel l.channel = channel
} }
func (l *lifecycle) Channel() ssh.Channel { func (l *lifecycle) Channel() ssh.Channel {
l.mu.Lock()
defer l.mu.Unlock()
return l.channel return l.channel
} }