add thread_restrictions.

Signed-off-by: wuliang <wuliang-b@360.cn>