Update threads.h

Added comments to the threading helper functions.