[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [sandboxed-tor-browser/master] Bug #20804: Temporarily kludge around the async/UI issue.



commit 22c94991236e6dff096e29fbb6e74c5a1d20c912
Author: Yawning Angel <yawning@xxxxxxxxxxxxxxx>
Date:   Mon Nov 28 02:56:54 2016 +0000

    Bug #20804:  Temporarily kludge around the async/UI issue.
    
    The ui code's async stuff (and all the code that uses it) is kind of a
    kludgy mess, and is race codnition prone particularly when handling
    cancelation.
    
    Work around the issue for now, till I have time to fix it properly by
    increasing channel capacity a tad.
---
 src/cmd/sandboxed-tor-browser/internal/ui/async/async.go | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/cmd/sandboxed-tor-browser/internal/ui/async/async.go b/src/cmd/sandboxed-tor-browser/internal/ui/async/async.go
index 83bbcae..5a894d2 100644
--- a/src/cmd/sandboxed-tor-browser/internal/ui/async/async.go
+++ b/src/cmd/sandboxed-tor-browser/internal/ui/async/async.go
@@ -98,9 +98,13 @@ func (async *Async) Grab(client *grab.Client, url string, hzFn func(string)) []b
 
 // NewAsync creates a new Async structure.
 func NewAsync() *Async {
+	// XXX; Temporarily work around bug #20804, by oversizing
+	// the channels a bit.  Things end up getting stuck on channel
+	// writes because it's kludged together, this should ensure that
+	// the writes succeed.
 	async := new(Async)
-	async.Cancel = make(chan interface{})
-	async.Done = make(chan interface{})
+	async.Cancel = make(chan interface{}, 2)
+	async.Done = make(chan interface{}, 2)
 	async.ToUI = make(chan interface{})
 	return async
 }

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits