This commit is contained in:
evilsocket 2018-01-16 10:32:09 +01:00
commit 9363649bce
2 changed files with 10 additions and 0 deletions

View file

@ -183,7 +183,9 @@ func (p ProtoPairList) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
func (d *Discovery) Show() error { func (d *Discovery) Show() error {
d.Session.Targets.Lock() d.Session.Targets.Lock()
d.Session.Queue.Lock()
defer d.Session.Targets.Unlock() defer d.Session.Targets.Unlock()
defer d.Session.Queue.Unlock()
iface := d.Session.Interface iface := d.Session.Interface
gw := d.Session.Gateway gw := d.Session.Gateway

View file

@ -151,6 +151,14 @@ func (q *Queue) Send(raw []byte) error {
} }
} }
func (q *Queue) Lock() {
q.lock.Lock()
}
func (q *Queue) Unlock() {
q.lock.Unlock()
}
func (q *Queue) Stop() { func (q *Queue) Stop() {
q.lock.Lock() q.lock.Lock()
defer q.lock.Unlock() defer q.lock.Unlock()