summary refs log tree commit diff stats
path: root/contrib/html
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2019-04-27 15:56:38 +0000
committerDrew DeVault <sir@cmpwn.com>2019-04-27 14:28:26 -0400
commit9ef2a57b51601cc0e18824bbfe8026891da1a38d (patch)
treef7f5ff2ba4e467dab56af13ef6993eac8addd481 /contrib/html
parent2159eb876e7e04e81f65e64b1d742ad832890289 (diff)
downloadaerc-9ef2a57b51601cc0e18824bbfe8026891da1a38d.tar.gz
worker/types: fix Worker.Callbacks race condition
Worker.Process* functions were called in different goroutines than
Worker.Post*. Protect the map with a mutex. Also make the map unexported to
prevent external unprotected accesses.

Worker.Process* functions used to delete items from the map. However they
didn't delete the element they retrieved: callbacks[msg.InResponseTo()] was
read while callbacks[msg] was deleted. I'm not sure I understand why. I tried
to delete the element that was accessed - but this broke everything (UI froze
at "Connecting..."). I don't believe any elements were actually removed from
the map, so the new code just doesn't remove anything.
Diffstat (limited to 'contrib/html')
0 files changed, 0 insertions, 0 deletions
4'>14 15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65