B.9.4 Blocking Within a Subsystem-Parallel Stack
Within a subsystem-parallel stack, it is very important that open and close procedures call the STREAMS functions StrmWaitForMutexObject, StrmWaitForMultipleObjects, and StrmWaitForSingleObject, instead of the functions KeWaitForMultipleObjects and KeWaitForSingleObject. This functional distinction is required because the STREAMS environment enforces serialization within a subsystem-parallel stack by the use of a per-subsystem Kernel mutex object. When a close procedure blocks, it expects other put or service procedures to run while it is blocked. The StrmWaitFor* functions release the per-subsystem mutex object before blocking, and reacquire the mutex object after being unblocked.