The one area that will get you in trouble is if you have two differnt critical sections....
OSCriticalSectionObj protectthis( bus_access );
OSCriticalSectionObj protectthis( list_access);
In this case its REALLY important that you always enter in the same order....
IE if in one code path you have
OSCriticalSectionObj protectthis( bus_access );
.
.
.
.
OSCriticalSectionObj protectthis( list_access);
And in a differnt code path (in a differnt task)
OSCriticalSectionObj protectthis( list_access);
.
.
.
.
OSCriticalSectionObj protectthis( bus_access );
You will eventually end up hung in a dead lock....
So if ANY path can acquire two or more critical resources then any other path that acquires these resources MUST DO THEM IN THE SAME ORDER.
USER_ENTER_CRITICAL also counts as a critical resource.....for this ordering rule.