mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00

* [NOD-1161] Name goroutines and log them by the name * [NOD-1161] Fix some goroutine names
12 lines
320 B
Go
12 lines
320 B
Go
package locks
|
|
|
|
// ReceiveFromChanWhenDone takes a blocking function and returns a channel that sends an empty struct when the function is done.
|
|
func ReceiveFromChanWhenDone(callback func()) <-chan struct{} {
|
|
ch := make(chan struct{})
|
|
spawn("ReceiveFromChanWhenDone", func() {
|
|
callback()
|
|
close(ch)
|
|
})
|
|
return ch
|
|
}
|