Reviewed-by: tschatzl, dholmes
Reviewed-by: rehn, dholmes
Support nested critical sections. Reviewed-by: eosterlund, rehn, tschatzl