only mainthread can call table pairs and histogram

Signed-off-by: zhangwei(Jovi) <jovi.zhangwei@gmail.com>