fixed build problem with threads on SmartOS