https://issues.apache.org/jira/browse/AMQCPP-546

Make the method in this class thread safe