Re: [go-nuts] this code sometimes hangs

2024-07-18 Thread Lammie Jonson
>> defer goroutineRunning.Done() This doesn't work. Each invocation of subscribe() has it's own sync.WaitGroup. It's just used it appears to ensure that the enclosed goroutine is running before subscribe() returns -- You received this message because you are subscribed to the Google Groups

[go-nuts] this code sometimes hangs

2024-07-18 Thread Lammie Jonson
// I am not sure why this code sometimes deadlocks, but sometimes it doesn't. // Hopefully someone will have some suggestions package main // ??? sometimes deadlocks import ( "fmt" "sync" "time" ) type Button struct { Clicked *sync.Cond } func main() { button := Button{