/* This function will free all resources consumed in the scenar_init() routine  */
static void scenar_fini(void)
/* This function will free all resources consumed in the scenar_init() routine  */
static void scenar_fini(void)
{
    int ret = 0;
    unsigned int i;
    for (i = 0; i < NSCENAR; i++) {
        if (scenarii[i].bottom != NULL)
            free(scenarii[i].bottom);
        ret = sem_destroy(&scenarii[i].sem);
        if (ret == -1)
            UNRESOLVED(errno, "Unable to destroy a semaphore");
        ret = pthread_attr_destroy(&scenarii[i].ta);
        if (ret != 0)
            UNRESOLVED(ret, "Failed to destroy a thread"
                   " attribute object");
    }
}