impl threshold cancellation

Signed-off-by: Akira Hayakawa <ruby.wktk@gmail.com>