PCT-671: make access to manager thread safe (use mutex)
PCT-671: s/q/query/