reverted to pthread locks