/**
 * 
 * @return 
 */
bool nvEncSession::deleteContext(void)
{
     INIT_CHECK();
     ADM_assert(context);
     if(!cudaCall(contextDestroy(context)))
     context=NULL;
     return true;
}
Exemple #2
0
int contextCreate(processApi_t context){
	int i, *fds = getFDs(schedCurrentProcess());
	void *stack =  (void*)getPage();

	if(stack == NULL)
		return -1;

	/* Si no seteo fds los heredo de mi padre */
	for( i = 0 ; i < MAX_OPENFILES ; i++){
		if(context->fds[i] == -1){
			context->fds[i] = fds[i];
		}
		else if(context->fds[i] == -2)
			context->fds[i] = -1;
	}

	int ret = procCreate(context->name, context->process, stack, NULL,
			context->fds, MAX_OPENFILES, context->argc, context->argv,
			procAttachedTTY(schedCurrentProcess()), 0, context->priority);

	if(ret != -1)
		contextDestroy(context);
	return ret;
}
	void callHandlersOnDestroy(){
		CALL(onDestroy()); 
		contextDestroy(); 
	}