Maybe, or maybe your don’t really want a critical section but use a mutex to protect the resource.
The key thing is that critical sections are usually SHORT sections of code where either you need to protect something from an ISR, or a short enough that the quickness of the critical section over other forms of protection makes it useful. If you really need to protect something from an ISR for that long, disable the needed interrupt.