NetBurner 3.3
Critical Section

OSCritEnter(), OSCritExit() and an OSCritObj enable an application to use counted critical sections that restrict resource access to to one task at a time (also called a “mutex”). For example, you have a linked list that is maintained by 3 separate tasks. If one task is manipulating the list, you call OSCritEnter() before modifying the list. If any other task tries to access the list, the task will block at the OSCritEnter() call until the task that previously called OSCritEnter(), calls OSCritExit(). Since this is a counting critical section implementation, the number of enter calls must match number of exit calls for each task.

OSCritObj is a C++ implementation that uses scoping to automatically call the enter and exit functions so you do not need to manually match each enter with an ext. In comparison with OsLock(), OsCritEnter() does not restrict task swapping unless two tasks want to access the same resource. OsLock() prevents all task swapping.