Copy of https://github.com/peter-lawrey/Java-Thread-Affinity