Hi Gilles,
I have added a check in

file          :   xenomai-2.5.6/ksrc/skins/native/task.c
function      :   int rt_task_delete(RT_TASK *task)

See my code signed with =======>

It seems if I'm working with a gdb session, the rt_task_delete() keep the lock of the killed thread.
With my additional check, all seems ok.

I could also insert my check directly in xnpod_delete_thread().

What do you think about ?
Paolo



// ********************************************************************************
int rt_task_delete(RT_TASK *task)
{
        int err = 0;
        spl_t s;

        if (!task) {
                if (!xnpod_primary_p())
                        return -EPERM;

                task = xeno_current_task();
        } else if (xnpod_asynch_p())
                return -EPERM;

        xnlock_get_irqsave(&nklock, s);

        task = xeno_h2obj_validate(task, XENO_TASK_MAGIC, RT_TASK);

        if (!task) {
                err = xeno_handle_error(task, XENO_TASK_MAGIC, RT_TASK);
                goto unlock_and_exit;
        }

        /* Make sure the target task is out of any safe section. */
        err = __native_task_safewait(task);

        if (err)
                goto unlock_and_exit;

        =========> if (xnthread_test_state(&task->thread_base, XNDEBUG))
=========> {
=========>     unlock_timers();
=========> }


        /* Does not return if task is current. */
        xnpod_delete_thread(&task->thread_base);

      unlock_and_exit:

        xnlock_put_irqrestore(&nklock, s);

        return err;
}
// ********************************************************************************


_______________________________________________
Xenomai mailing list
[email protected]
http://www.xenomai.org/mailman/listinfo/xenomai

Reply via email to