@cryptotaxi247 / kubo / commits / cc2a7312a

add comment to fix race

License: MIT Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

Brian Tiger Chow committed Dec 16, 2014 at 21:25 UTC cc2a7312a28e7fd12eed75f85890cb528feb6cb5
1 file changed +5 -3
exchange/bitswap/strategy/ledgermanager.go
+5 -3
@@ -23,9 +23,11 @@ type Envelope struct {
23 }
24
25 type LedgerManager struct {
26 - lock sync.RWMutex
27 - ledgerMap ledgerMap
28 - bs bstore.Blockstore
26 + lock sync.RWMutex
27 + ledgerMap ledgerMap
28 + bs bstore.Blockstore
29 + // FIXME tasklist isn't threadsafe nor is it protected by a mutex. consider
30 + // a way to avoid sharing the tasklist between the worker and the receiver
31 tasklist *taskList
32 outbox chan Envelope
33 workSignal chan struct{}