All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Minazzi <Paolo.Minazzi@mitrol.it>
To: xenomai@xenomai.org
Subject: Re: [Xenomai] Re : Sporadic problem : rt_task_sleep locked after debugging
Date: Wed, 08 May 2013 10:03:21 +0200	[thread overview]
Message-ID: <518A06C9.50204@mitrol.it> (raw)
In-Reply-To: <5183CDD6.80400@mitrol.it>

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;
}
// 
********************************************************************************



  reply	other threads:[~2013-05-08  8:03 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-02 13:49 [Xenomai] Re : Sporadic problem : rt_task_sleep locked after debugging Paolo Minazzi
2013-05-03  1:06 ` Gilles Chanteperdrix
2013-05-03 14:46   ` Paolo Minazzi
2013-05-08  8:03     ` Paolo Minazzi [this message]
2013-05-08 12:58       ` Gilles Chanteperdrix
     [not found]         ` <518A505C.2090207@mitrol.it>
     [not found]           ` <518A52A7.5000801@xenomai.org>
     [not found]             ` <518A5600.20508@mitrol.it>
2013-05-08 14:30               ` Paolo Minazzi
2013-05-08 14:43                 ` Gilles Chanteperdrix
2013-05-08 16:06                 ` Philippe Gerum
2013-05-08 16:10                   ` Philippe Gerum
2013-05-09 13:36                     ` Philippe Gerum
2013-05-09 13:52                       ` Paolo Minazzi
2013-05-09 13:58                         ` Gilles Chanteperdrix
2013-05-09 14:04                           ` Philippe Gerum
2013-05-09 14:08                             ` Philippe Gerum
2013-05-10  6:47                               ` Paolo Minazzi
2013-06-17  7:20                                 ` Philippe Gerum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=518A06C9.50204@mitrol.it \
    --to=paolo.minazzi@mitrol.it \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.