mirror of
https://github.com/tursom/GoCollections.git
synced 2025-02-26 20:20:31 +08:00
18 lines
210 B
Go
18 lines
210 B
Go
package concurrent
|
|
|
|
import (
|
|
"sync"
|
|
|
|
"github.com/petermattis/goid"
|
|
)
|
|
|
|
func GetGoroutineID() int64 {
|
|
return goid.Get()
|
|
}
|
|
|
|
func WaitCond(cond *sync.Cond) {
|
|
cond.L.Lock()
|
|
defer cond.L.Unlock()
|
|
cond.Wait()
|
|
}
|