Add set_max_level_racy and gate set_max_level
#544
Merged
set_max_level_racy and gate set_max_level
#544