>From our discussion on the call, the idea in the linux-generic term functions is just to point out to the application that it did not clean up correctly (i.e. here it prints an error message about a pool not being destroyed).
Beyond that it's assumed that the operating system will clean everything up when the process exists. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Maxim Uvarov Sent: Tuesday, February 24, 2015 8:20 AM To: [email protected] Subject: Re: [lng-odp] [PATCHv3 06/10] linux-generic: buffer_pool: add term_global On 02/23/2015 11:36 PM, Robbie King wrote: > +int odp_pool_term_global(void) > +{ > + int i; > + pool_entry_t *pool; > + int ret = 0; > + int rc = 0; > + > + for (i = 0; i < ODP_CONFIG_POOLS; i++) { > + pool = get_pool_entry(i); > + > + POOL_LOCK(&pool->s.lock); > + if (pool->s.pool_shm != ODP_SHM_INVALID) { > + ODP_ERR("Not destroyed pool: %s\n", pool->s.name); > + rc = -1; > + } > + POOL_UNLOCK(&pool->s.lock); > + } what this for does? you should do: pool->s.name[0] = 0; pool->s.flags.has_name = 1; unmap(pool->s.pool_base_addr); Also I would like to zero everything that odp_pool_create() created. Including atomic counters. Thanks, Maxim. > + > + ret = odp_shm_free(odp_shm_lookup(SHM_DEFAULT_NAME)); > + if (ret < 0) { > + ODP_ERR("shm free failed for %s", SHM_DEFAULT_NAME); > + rc = -1; > + } > + > + return rc; > +} > + _______________________________________________ lng-odp mailing list [email protected] http://lists.linaro.org/mailman/listinfo/lng-odp _______________________________________________ lng-odp mailing list [email protected] http://lists.linaro.org/mailman/listinfo/lng-odp
