SVR5
freezestr(D3str)
freezestr --
freeze the state of a stream
Synopsis (Not in ODDI)
#include <sys/types.h>
#include <sys/stream.h>
#include <sys/ddi.h>
pl_t freezestr(queue_t *q);
Description
freezestr sets the interrupt priority level to plstr
(if the current level is lower than plstr and the implementation
requires that interrupts be blocked while the
stream is frozen) and freezes the state of the stream containing the
queue specified by q.
Freezing the stream prevents any further entries into open, close, put,
and service procedures on the stream and prevents any messages from
being placed on or taken off any queues in the stream (except by the
caller of freezestr).
Freezing the stream does not automatically stop all functions that are running
within the stream;
functions will continue to run until they attempt to perform some operation
which changes the state of the stream, at which point
they will be forced to wait for the stream to be unfrozen by a call to
unfreezestr(D3str).
Arguments
q-
Pointer to a message queue.
Return values
freezestr returns the previous interrupt priority level which is
typically used in a subsequent call to unfreezestr.
Usage
Drivers and modules must freeze the stream while they manipulate its
queues directly. This includes searching the queues
and for the duration of any calls to
insq(D3str),
rmvq(D3str),
strqset(D3str),
and
strqget(D3str).
Context
Base or Interrupt.
Synchronization constraints
Does not block.
Driver-defined basic locks, read/write locks, and sleep locks
may be held across calls to this function.
Warnings
freezestr should be used sparingly
as it is rarely necessary to freeze a stream
(most modules do not need to manipulate their queues directly)
and freezing a stream can have a significant negative effect
on performance.
Calling freezestr to freeze a stream that is already frozen by
the caller will result in deadlock.
Examples
See
insq(D3str)
for an example of freezestr.
Hardware applicability
All
Version applicability
ddi:
3, 5, 5mp, 6, 6mp, 7, 7mp, 7.1, 7.1mp, 8, 8mp
References
unfreezestr(D3str)
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005