common: add Mac OS X support
threads: add Mac OS X support