[Previous] [Contents] [Next]

dispatch_context_free()

Free a dispatch context

Synopsis:

#include <sys/dispatch.h>

void dispatch_context_free(
        dispatch_context_t * ctp );

Library:

libc

Description:

The dispatch_context_free() function frees the dispatch context ctp (that was allocated by dispatch_context_alloc()).

Examples:

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

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

   if( ( dpp = dispatch_create() ) == NULL ) {
     fprintf( stderr, "%s: Unable to allocate
              dispatch handle.\n",argv[0] );
     return EXIT_FAILURE;
   }

   ... 

   ctp = dispatch_context_alloc( dpp );

   ...

   dispatch_context_free ( ctp );   
   return EXIT_SUCCESS;
}

See dispatch_create(), message_attach(), resmgr_attach(), and thread_pool_create() for examples using the dispatch interface.

Classification:

QNX 6

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

See also:

dispatch_context_alloc()

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


[Previous] [Contents] [Next]