liveh2o/active_remote — pull request #24 by brianstien (2014-06-27 20:47:26+00:00)
Title: Make protobuf adapter threadsafe

Since there is only a single instance of the rpc adater at the class
level that all service calls use, when working in a multithreaded
environment, we end up in a case where multiple threads are sharing the
same instance of the rpc adater class and therefore sharing the same
instance variables.

The problem causes undetermined results from service calls. By removing
the instance variables and using local variables, it is safe to use the
same instance of the rpc adater from multiple threads.

An alternative solution would be to use a new instance of the rpc adater
for each service call, if you want to keep the instance varaibles.