Module: xenomai-jki
Branch: queues/heap
Commit: cfc97f45b1544e1e9baee8653a5b6830bc7d8605
URL:    
http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=cfc97f45b1544e1e9baee8653a5b6830bc7d8605

Author: Jan Kiszka <jan.kis...@siemens.com>
Date:   Wed Nov 11 13:28:12 2009 +0100

native: Do not requeue on auto-cleanup errors

Migrating an object to the global queue in case of an error during
deletion is racy and may paper over potential bugs. Now that the main
reason for this approach is no longer existing (rt_heap/queue_delete
will not return EBUSY anymore), replace the requeueing with basic
consistency checks.

Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>

---

 include/native/ppd.h |   16 ++++------------
 1 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/include/native/ppd.h b/include/native/ppd.h
index 3dbda6a..c6e7479 100644
--- a/include/native/ppd.h
+++ b/include/native/ppd.h
@@ -101,19 +101,11 @@ static inline xeno_rholder_t *xeno_get_rholder(void)
                        xnlock_put_irqrestore(&nklock, s);              \
                        obj = rlink2##__name(holder);                   \
                        err = rt_##__name##_delete(obj);                \
+                       XENO_ASSERT(NATIVE, !err || err == -EIDRM, );   \
                        __xeno_trace_release(#__name, obj, err);        \
-                       if (unlikely(err)) {                            \
-                               if ((__rq) != 
&__native_global_rholder.__name##q) { \
-                                       xnlock_get_irqsave(&nklock, s); \
-                                       nholder = popq((rq), holder);   \
-                                       
appendq(&__native_global_rholder.__name##q, holder); \
-                                       obj->rqueue = 
&__native_global_rholder.__name##q; \
-                               }                                       \
-                       } else {                                        \
-                               if (__release)                          \
-                                       __xeno_release_obj(obj);        \
-                               xnlock_get_irqsave(&nklock, s);         \
-                       }                                               \
+                       if (!err && __release)                          \
+                               __xeno_release_obj(obj);                \
+                       xnlock_get_irqsave(&nklock, s);                 \
                }                                                       \
                xnlock_put_irqrestore(&nklock, s);                      \
        } while(0)


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to