| ![[Previous]](../prev.gif) | ![[Contents]](../contents.gif) | ![[Index]](../keyword_index.gif) | ![[Next]](../next.gif) | 
Free a dispatch context
#include <sys/iofunc.h>
#include <sys/dispatch.h>
void dispatch_context_free(
        dispatch_context_t * ctp );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The dispatch_context_free() function frees the given dispatch context.
This function is part of the dispatch layer of a resource manager. For more information, see “Layers in a resource manager” in the Bones of a Resource Manager chapter of Writing a Resource Manager.
#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.
| Safety: | |
|---|---|
| Cancellation point | No | 
| Interrupt handler | No | 
| Signal handler | No | 
| Thread | Yes | 
“Layers in a resource manager” in the Bones of a Resource Manager chapter of Writing a Resource Manager
| ![[Previous]](../prev.gif) | ![[Contents]](../contents.gif) | ![[Index]](../keyword_index.gif) | ![[Next]](../next.gif) |