Critical sections may be nested. Implement a way to keep track of them so we don't enable context switching when we don't want to