|
| iMatix home page | << | < | > | >> |
SMTVersion 2.81 |
#include "smtlib.h"
int
event_discard (
QUEUE *queue, /* Queue to take event from */
EVENT *event /* Event, or null */
)
Discards the specified event in the specified queue. The event iterate (), event accept () and event discard () calls let a thread manipulate its event queue directly. In such cases the thread takes responsibility for event delivery and acknowledgement. Returns 0 when successfully completed. In case of error, returns -1 and sets smt_errno to one of these values:
| SMT NOTREADY | smt_init() was not called, or failed |
| SMT QUEUEISEMPTY | The queue was empty |
{
#if (defined (SMT_TRACE))
trace ("event_discard");
#endif
ASSERT (queue);
if (!smt_alive) /* If SMT API was not correctly */
{ /* initialised, forget it */
smt_errno = SMT_NOTREADY;
return (-1);
}
if ((event = event_locate (queue, event)) == NULL)
return (-1);
queue-> cur_events--; /* Count the event */
event destroy (event); /* Unlink and destroy event */
return (0);
}
| | << | < | > | >> |
|