1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-04-24 14:39:10 -04:00

remove context in struct

This commit is contained in:
Darien Raymond
2018-02-08 15:39:46 +01:00
parent a1ae4aa515
commit efcb567273
44 changed files with 379 additions and 270 deletions

View File

@@ -1,22 +1,22 @@
package signal
type Notifier struct {
c chan bool
c chan struct{}
}
func NewNotifier() *Notifier {
return &Notifier{
c: make(chan bool, 1),
c: make(chan struct{}, 1),
}
}
func (n *Notifier) Signal() {
select {
case n.c <- true:
case n.c <- struct{}{}:
default:
}
}
func (n *Notifier) Wait() <-chan bool {
func (n *Notifier) Wait() <-chan struct{} {
return n.c
}