A program must behave correctly and consistently with all conceivable scheduling sequences that are compatible with the rules above.
For example, if threadprivate storage is accessed (explicitly in the source code or implicitly in calls to library routines) in one part of a task region, its value cannot be assumed to be preserved into the next part of the same task region if another schedulable task exists that modifies it.
As another example, if a lock acquire and release happen in different parts of a task region, no attempt should be made to acquire the same lock in any part of another task that the executing thread may schedule. Otherwise, a deadlock is possible. A similar situation can occur when a critical region spans multiple parts of a task and another schedulable task contains a critical region with the same name.
The use of threadprivate variables and the use of locks or critical sections in an explicit task with an if clause must take into account that when the if clause evaluates to false, the task is executed immediately, without regard to Task Scheduling Constraint 2.