Merging branch/2013-06-18/macosx-threads back to master.