Threadmonitors

This supersedes #2597