veyron/runtimes/google/lib/publisher: Remove write/close race in the publisher cmdchan.

In this solution we make commands issued after publisher.Stop is called into noops.
This is easy to implmenet, but somewhat ugly since now we have a channel and
a mutex.

A better solution is probably to just rewrite the publisher as a mutex controlled
object and eliminate the runLoop.  Another option is to make it part of the
publishers interface contract that you're not allowed to call any methods concurrently
or after calling Stop.  This, however, will result in a lot of synchronization code
being added to server.go which is already complex.

I considered eliminating the close(p.cmdchan) in favor of a closecmd message.
That solution would be deadlock prone since several operations could come in
after a closecmd is issued and the channel would fill.

Change-Id: Id9c6b2f41996e80eec3554aabccd87c084b3bb4d
1 file changed
tree: 3e8f2f33ce9c44f6758be0014217d95932a9d249
  1. lib/
  2. profiles/
  3. runtimes/
  4. security/
  5. services/
  6. tools/