dotcloud/docker — pull request #271 by robryk (2013-03-30 13:55:32+00:00)
Title: writeBroadcaster: thread safety and using a map instead of a list

writeBroadcaster seems to be used concurrently by Container.StdoutPipe (as far as I can tell, it isn't very strange to call it when there are some writes happening).

RemoveWriter currently requires concrete writers to support equality operators. While that's nearly always the case (pointers do), we still might wish to just do away with the function. I've added a comment warning about that.

I couldn't see a reason why a list was preferable to a map, so I assume that there is none. If that's the case, the second commit simplifies writeBroadcaster a bit. In that case, Runtime.containers should probably undergo the same treatment.