Added getThreadId() support for MAC OSX