added locking for access/modification to PubSubData data structures