services/syncbase: fix --race errors.

Fix race conditions detected by Syncbase --race testing:
* Add a mutex for a random number generator that uses a NewSource().
* Goroutines spawned in a loop must get a copy of the loop iterator,
  not access it through closure.

Change-Id: I88094fceac6708be2a3fbb49d2861de105534c80
2 files changed
tree: 5ff3cdb842a643efde22982258d4abb3a330c4d0
  1. v23/
  2. x/
  3. .gitignore
  4. AUTHORS
  5. CONTRIBUTORS
  6. LICENSE
  7. PATENTS
  8. VERSION