Revert "fix thread locK"

This reverts commit 41eef556dbb2f4234bb46c036f81b3c511d606ee.
Revert "thread safe helpers"

This reverts commit 81ad1f6f651ba5bc8b4323348a0036faafa686fc.