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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Mon Dec 19 17:57:44 2011 +0100

copperplate/syncobj: inline syncobj_flush()

---

 include/copperplate/syncobj.h |   15 +++++++++++++--
 lib/copperplate/syncobj.c     |   13 -------------
 2 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/include/copperplate/syncobj.h b/include/copperplate/syncobj.h
index 55f3c50..0fe0d85 100644
--- a/include/copperplate/syncobj.h
+++ b/include/copperplate/syncobj.h
@@ -149,8 +149,6 @@ int syncobj_wait_drain(struct syncobj *sobj,
                       const struct timespec *timeout,
                       struct syncstate *syns);
 
-int syncobj_flush(struct syncobj *sobj);
-
 int syncobj_destroy(struct syncobj *sobj,
                    struct syncstate *syns);
 
@@ -201,6 +199,19 @@ static inline int syncobj_grant_all(struct syncobj *sobj)
        return ret;
 }
 
+static inline int syncobj_flush(struct syncobj *sobj)
+{
+       __syncobj_check_locked(sobj);
+
+       if (sobj->grant_count > 0)
+               __syncobj_broadcast_grant(sobj, SYNCOBJ_FLUSHED);
+
+       if (sobj->drain_count > 0)
+               __syncobj_broadcast_drain(sobj, SYNCOBJ_FLUSHED);
+
+       return sobj->wait_count;
+}
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/copperplate/syncobj.c b/lib/copperplate/syncobj.c
index dbd8f5f..24770f3 100644
--- a/lib/copperplate/syncobj.c
+++ b/lib/copperplate/syncobj.c
@@ -313,19 +313,6 @@ int __syncobj_broadcast_drain(struct syncobj *sobj, int 
reason)
        return ret;
 }
 
-int syncobj_flush(struct syncobj *sobj)
-{
-       __syncobj_check_locked(sobj);
-
-       if (sobj->grant_count > 0)
-               __syncobj_broadcast_grant(sobj, SYNCOBJ_FLUSHED);
-
-       if (sobj->drain_count > 0)
-               __syncobj_broadcast_drain(sobj, SYNCOBJ_FLUSHED);
-
-       return sobj->wait_count;
-}
-
 static inline void enqueue_waiter(struct syncobj *sobj,
                                  struct threadobj *thobj)
 {


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

Reply via email to