So here is the code:

void *thread2(void *cookie)
{
        /* ... */
}

int create_thread(pthread_t* t, const char* name, void *(*)(void *) funct,
void* arg)
{
        /* ... */
        pthread_create(t, ..., funct, arg);
        /* ... */

        pthread_set_name_np(t, name);
        /* ... */
}

int *thread(void *cookie)
{
    pthread_t tid1;
    pthread_t tid2;

    create_thread(&tid1, "name1", thread2, NULL);
    create_thread(&tid2, "name2", thread2, NULL);

    /* ... */

    pthread_cancel(&tid1);
    pthread_cancel(&tid2);

     /* ... */
}

The name "name1" "name2" are not stored in a variable.
_______________________________________________
Xenomai mailing list
[email protected]
http://www.xenomai.org/mailman/listinfo/xenomai

Reply via email to