Module: xenomai-3
Branch: next
Commit: 22a230ddbf874ed289b6c4606c5851193b422164
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=22a230ddbf874ed289b6c4606c5851193b422164

Author: Philippe Gerum <r...@xenomai.org>
Date:   Mon Jun  1 13:35:34 2015 +0200

copperplate/heapobj: fix build issue

---

 lib/copperplate/cluster.c        |   16 ++++++++++++++--
 lib/copperplate/heapobj-malloc.c |    1 +
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/lib/copperplate/cluster.c b/lib/copperplate/cluster.c
index 7353aa8..b19d1c8 100644
--- a/lib/copperplate/cluster.c
+++ b/lib/copperplate/cluster.c
@@ -91,6 +91,7 @@
 #include <errno.h>
 #include <string.h>
 #include <memory.h>
+#include <stdio.h>
 #include "copperplate/heapobj.h"
 #include "copperplate/cluster.h"
 #include "copperplate/syncobj.h"
@@ -257,6 +258,7 @@ redo:
        if (hobj) {
                d = container_of(hobj, struct syndictionary, hobj);
                ret = 0;
+               printf("existing cluster %s found at %p\n", name, sc);
                goto out;
        }
 
@@ -277,6 +279,7 @@ redo:
                xnfree(d);
                goto redo;
        }
+       printf("new cluster %s at %p\n", name, sc);
 out:
        sc->d = d;
 
@@ -299,19 +302,25 @@ int syncluster_addobj(struct syncluster *sc, const char 
*name,
 
        ret = hash_enter_probe(&sc->d->table, name, strlen(name),
                               &cobj->hobj, &hash_operations);
+       printf("entering object %s => %d\n", name, ret);
        if (ret)
                goto out;
 
-       if (!syncobj_grant_wait_p(&sc->d->sobj))
+       if (!syncobj_grant_wait_p(&sc->d->sobj)) {
+               printf("no waiter on cluster %Zu\n",
+                      mainheap_ref(&sc->d->sobj, uintptr_t));
                goto out;
+       }
        /*
         * Wake up all threads waiting for this key to appear in the
         * dictionary.
         */
        syncobj_for_each_grant_waiter_safe(&sc->d->sobj, thobj, tmp) {
                wait = threadobj_get_wait(thobj);
-               if (*wait->name == *name && strcmp(wait->name, name) == 0)
+               if (*wait->name == *name && strcmp(wait->name, name) == 0) {
+                       printf("signaling %s\n", thobj->name);
                        syncobj_grant_to(&sc->d->sobj, thobj);
+               }
        }
 out:
        syncobj_unlock(&sc->d->sobj, &syns);
@@ -368,7 +377,10 @@ int syncluster_findobj(struct syncluster *sc,
                        wait = threadobj_prepare_wait(struct 
syncluster_wait_struct);
                        wait->name = name;
                }
+               printf("(waiting for %s to show up on cluster sobj %Zu)\n", 
name,
+                      mainheap_ref(&sc->d->sobj, uintptr_t));
                ret = syncobj_wait_grant(&sc->d->sobj, timeout, &syns);
+               printf("(back from wait %d)\n", ret);
                if (ret) {
                        if (ret == -EIDRM)
                                goto out;
diff --git a/lib/copperplate/heapobj-malloc.c b/lib/copperplate/heapobj-malloc.c
index 60894eb..b77cf09 100644
--- a/lib/copperplate/heapobj-malloc.c
+++ b/lib/copperplate/heapobj-malloc.c
@@ -110,6 +110,7 @@ void *pvheapobj_alloc(struct heapobj *hobj, size_t size)
 {
        struct pool_header *ph = hobj->pool;
        struct block_header *bh;
+       void *ptr;
 
        write_lock(&ph->lock);
 


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://xenomai.org/mailman/listinfo/xenomai-git

Reply via email to