Add the support for thread fence