void destroy_context(struct mm_struct *mm)
{
#ifdef CONFIG_SPAPR_TCE_IOMMU
	WARN_ON_ONCE(!list_empty(&mm->context.iommu_group_mem_list));
#endif
	if (radix_enabled())
		WARN_ON(process_tb[mm->context.id].prtb0 != 0);
	else
		subpage_prot_free(mm);
	destroy_contexts(&mm->context);
	mm->context.id = MMU_NO_CONTEXT;
}
示例#2
0
int main(int argc, const char *argv[])
{
    if(setup_cli(argc, argv) == -1) {
        usage(argv[0]);
        return EXIT_FAILURE;
    }

    config.syslog = 0;
    config.loglevel = CRIT;
    config.bufsize = 16384;
    config.thread = 1;

    struct node_conf conf = {NULL, 0};
    build_contexts();
    struct context *contexts = get_contexts();

    memcpy(&config.node, &conf, sizeof(config.node));
    slot_start_manager(&contexts[config.thread]);

    RUN_CASE(test_slot);
    RUN_CASE(test_hash);
    RUN_CASE(test_parser);
    RUN_CASE(test_cmd);
    RUN_CASE(test_server);
    RUN_CASE(test_dict);
    RUN_CASE(test_socket);
    RUN_CASE(test_client);
    RUN_CASE(test_timer);
    RUN_CASE(test_config);
    RUN_CASE(test_stats);
    RUN_CASE(test_mbuf);
    RUN_CASE(test_slowlog);

    usleep(10000);
    slot_create_job(SLOT_UPDATER_QUIT);
    pthread_join(contexts[config.thread].thread, NULL);

    for (int i = 0; i <= config.thread; i++) {
        context_free(&contexts[i]);
    }

    destroy_contexts();

    report();
    return manager.failed == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
static void
gupnp_simple_context_manager_dispose (GObject *object)
{
        GUPnPSimpleContextManager *manager;
        GObjectClass *object_class;

        manager = GUPNP_SIMPLE_CONTEXT_MANAGER (object);

        destroy_contexts (manager);

        if (manager->priv->idle_context_creation_src) {
                g_source_destroy (manager->priv->idle_context_creation_src);
                manager->priv->idle_context_creation_src = NULL;
        }


        /* Call super */
        object_class = G_OBJECT_CLASS (gupnp_simple_context_manager_parent_class);
        object_class->dispose (object);
}