[Previous] [Contents] [Next]

dispatch_destroy()

Destroy a dispatch handle

Synopsis:

#include <sys/dispatch.h>

int dispatch_destroy( dispatch_t *dpp );

Library:

libc

Description:

The function dispatch_destroy() destroys the dispatch handle dpp (created by dispatch_create()).

Returns:

0
Success.
-1
An error occurred; errno is set.

Errors:

EINVAL
Dispatch handle dpp is invalid.

Examples:

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

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

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

   ...
    
   if ( (destroyed = dispatch_destroy ( dpp )) == -1 ) {
      fprintf ( stderr, "Dispatch wasn't destroyed, \
                bad dispatch handle %d.\n", dpp);
      return EXIT_FAILURE;
   }
   /* else dispatch was destroyed */

   ...
   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_create()


[Previous] [Contents] [Next]