The JPL documentation includes a section on Multi-Threaded Queries that makes total sense. However, there seems to not be anymore the public static method Query.lock to be used in the applications.
All core query predicates (e.g., hasSolution) are synchronized static methods, but when combined with iteration, issues may arise if I understood well.
I went back even to the first commit of the repo and I couldn't find that lock() method, even though they are referred to in the source code, for example:
To ensure thread-safety, you should wrap sequential calls to
* this method in a synchronized block, using the static
* lock method to obtain the monitor.
* <pre>
* Query q = // obtain Query reference
* synchronized ( jpl.Query.lock() ){
* while ( q.hasMoreElements() ){
* Hashtable solution = q.nextSolution();
* // process solution...
* }
* }