Someone got in touch with me today and pointed out a bug in this code, but it was already fixed by me some time ago. I've refreshed the gist with the latest versions of these classes, but the upstream project is now fully open source. You can get the latest code here:
https://github.com/vinumeris/lighthouse/tree/master/common/src/main/java/lighthouse/threading I should probably turn this into a little self contained library at some point.
