Освободить память, выделенную под контекст менеджера ресурсов
#include <sys/iofunc.h>#include <sys/dispatch.h>void resmgr_context_free( resmgr_context_t *ctp );
libc
Функция resmgr_context_free() освобождает ресурсы, выделенные под контекст функцией resmgr_context_alloc().
![]() | Данная функция является частным случаем dispatch_context_free(). Следует использовать ее только при написании простого менеджера ресурсов. |
#include <sys/dispatch.h>#include <stdio.h>#include <stdlib.h>int main( int argc, char **argv ){dispatch_t *dpp;resmgr_context_t *ctp;if ( (dpp = dispatch_create()) == NULL ){fprintf( stderr, "%s: Unable to allocate dispatch handle.\n", argv[0] );return (EXIT_FAILURE);}...if ( ( ctp = resmgr_context_alloc( dpp )) == NULL ){fprintf( stderr, "Context wasn't allocated.\n" );return (EXIT_FAILURE);}...resmgr_context_free( ctp );}
Другие примеры, использующие интерфейс диспетчера см. на страницах dispatch_create(), message_attach(), resmgr_attach(), и thread_pool_create().
ЗОСРВ «Нейтрино»
resmgr_context_alloc(), resmgr_context_t
Предыдущий раздел: Описание API системной библиотеки