Thread Safe Query.