Module: xenomai-forge
Branch: master
Commit: ab521543c480a1c43444e171ec50ae92bb3ddf4a
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=ab521543c480a1c43444e171ec50ae92bb3ddf4a

Author: Philippe Gerum <r...@xenomai.org>
Date:   Tue Dec 13 16:17:24 2011 +0100

copperplate/syncluster: add missing wakeup code in private variant

---

 lib/copperplate/cluster.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/lib/copperplate/cluster.c b/lib/copperplate/cluster.c
index 01e6abf..70d8bd4 100644
--- a/lib/copperplate/cluster.c
+++ b/lib/copperplate/cluster.c
@@ -385,6 +385,8 @@ void pvsyncluster_destroy(struct pvsyncluster *sc)
 int pvsyncluster_addobj(struct pvsyncluster *sc, const char *name,
                        struct pvclusterobj *cobj)
 {
+       struct syncluster_wait_struct *wait;
+       struct threadobj *thobj, *tmp;
        struct syncstate syns;
        int ret;
 
@@ -392,7 +394,21 @@ int pvsyncluster_addobj(struct pvsyncluster *sc, const 
char *name,
                return __bt(-EINVAL);
 
        ret = pvcluster_addobj(&sc->c, name, cobj);
+       if (ret)
+               goto out;
 
+       if (!syncobj_pended_p(&sc->sobj))
+               goto out;
+       /*
+        * Wake up all threads waiting for this key to appear in the
+        * dictionary.
+        */
+       syncobj_for_each_waiter_safe(&sc->sobj, thobj, tmp) {
+               wait = threadobj_get_wait(thobj);
+               if (*wait->name == *name && strcmp(wait->name, name) == 0)
+                       syncobj_wakeup_waiter(&sc->sobj, thobj);
+       }
+out:
        syncobj_unlock(&sc->sobj, &syns);
 
        return ret;


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

Reply via email to