| iMatix home page
| << | < | > | >>
SMT Logo SMT
Version 2.81

 

event_discard

#include "smtlib.h"
int
event_discard (
    QUEUE *queue,                       /*  Queue to take event from         */
    EVENT *event                        /*  Event, or null                   */
)

Synopsis

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

Source Code - (smtlib.c)

{
#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);
}

| << | < | > | >> iMatix Copyright © 1996-99 iMatix Corporation