[Previous] [Contents] [Next]

dispatch_handler()

Handle events received by dispatch_block

Synopsis:

#include <sys/dispatch.h>

int dispatch_handler( dispatch_context_t * ctp );

Library:

libc

Description:

The dispatch_handler() function handles events received by dispatch_block(). Depending on the blocking type, dispatch_handler() does one of the following:

Returns:

0
Success.
-1
This may occur for a number of reasons:

In any case, if the message wasn't a pulse, then the client will be replied to with an appropriate errno.

Examples:

#include <stdlib.h>
#include <sys/dispatch.h>

int main( int argc, char **argv ) {
   dispatch_context_t   *ctp;

   ...

   for(;;) {
     if( ctp = dispatch_block( ctp ) ) {
       dispatch_handler( ctp );
     }
   }
   return EXIT_SUCCESS;
}

For examples using the dispatch interface, see dispatch_create(), message_attach(), resmgr_attach(), and thread_pool_create().

Classification:

QNX 6

Safety:
Cancellation point Yes
Interrupt handler No
Signal handler No
Thread Yes

See also:

dispatch_block(), dispatch_create(), dispatch_timeout()

"Components of a Resource Manager" section of the Writing a Resource Manager chapter in the Programmer's Guide.


[Previous] [Contents] [Next]