From cc2a7312a28e7fd12eed75f85890cb528feb6cb5 Mon Sep 17 00:00:00 2001 From: Brian Tiger Chow Date: Tue, 16 Dec 2014 21:25:37 -0800 Subject: [PATCH] add comment to fix race License: MIT Signed-off-by: Brian Tiger Chow --- exchange/bitswap/strategy/ledgermanager.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/exchange/bitswap/strategy/ledgermanager.go b/exchange/bitswap/strategy/ledgermanager.go index 4bc8f2efc..d328510a1 100644 --- a/exchange/bitswap/strategy/ledgermanager.go +++ b/exchange/bitswap/strategy/ledgermanager.go @@ -23,9 +23,11 @@ type Envelope struct { } type LedgerManager struct { - lock sync.RWMutex - ledgerMap ledgerMap - bs bstore.Blockstore + lock sync.RWMutex + ledgerMap ledgerMap + bs bstore.Blockstore + // FIXME tasklist isn't threadsafe nor is it protected by a mutex. consider + // a way to avoid sharing the tasklist between the worker and the receiver tasklist *taskList outbox chan Envelope workSignal chan struct{}