|
|
stream->lock
prior to calling any C client stream functions. Any attempt to call
a mail_xxx function while one is already in progress on
the same stream will cause the application to fail in unpredictable
ways.
Note that this check is insufficient in a preemptive-scheduling multi-tasking application due to the possibility of a timing race. Such applications must be written so that only one process accesses the stream, or to have a higher level lock.
Since MAIL operations will not finish until they are completed, a single-tasking application does not have to worry about this problem, except in the callback invoked from MAIL (for example, mm_exists, and so on) in which case the stream is always locked.