integrated fix using SGIF_THREADSAFE ifdef