Module: xenomai-forge Branch: master Commit: cb261a216396e6b46cdd15bf1234096d3a1a1bbc URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=cb261a216396e6b46cdd15bf1234096d3a1a1bbc
Author: Philippe Gerum <[email protected]> Date: Fri Dec 2 23:08:36 2011 +0100 copperplate/syncobj: inline enqueuing code --- lib/copperplate/syncobj.c | 38 +++++++++++++++++++------------------- 1 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lib/copperplate/syncobj.c b/lib/copperplate/syncobj.c index 17e68ee..8b7fe81 100644 --- a/lib/copperplate/syncobj.c +++ b/lib/copperplate/syncobj.c @@ -272,25 +272,6 @@ static void syncobj_test_finalize(struct syncobj *sobj, pthread_setcancelstate(syns->state, NULL); } -static void enqueue_waiter(struct syncobj *sobj, - struct threadobj *thobj) -{ - struct threadobj *__thobj; - - thobj->wait_prio = threadobj_get_priority(thobj); - sobj->pend_count++; - if ((sobj->flags & SYNCOBJ_PRIO) == 0 || list_empty(&sobj->pend_list)) { - list_append(&thobj->wait_link, &sobj->pend_list); - return; - } - - list_for_each_entry_reverse(__thobj, &sobj->pend_list, wait_link) { - if (thobj->wait_prio <= __thobj->wait_prio) - break; - } - ath(&__thobj->wait_link, &thobj->wait_link); -} - int __syncobj_signal_drain(struct syncobj *sobj) { /* Release one thread waiting for the object to drain. */ @@ -323,6 +304,25 @@ void __syncobj_cleanup_wait(struct syncobj *sobj, struct threadobj *thobj) monitor_exit(sobj); } +static inline void enqueue_waiter(struct syncobj *sobj, + struct threadobj *thobj) +{ + struct threadobj *__thobj; + + thobj->wait_prio = threadobj_get_priority(thobj); + sobj->pend_count++; + if ((sobj->flags & SYNCOBJ_PRIO) == 0 || list_empty(&sobj->pend_list)) { + list_append(&thobj->wait_link, &sobj->pend_list); + return; + } + + list_for_each_entry_reverse(__thobj, &sobj->pend_list, wait_link) { + if (thobj->wait_prio <= __thobj->wait_prio) + break; + } + ath(&__thobj->wait_link, &thobj->wait_link); +} + int syncobj_pend(struct syncobj *sobj, const struct timespec *timeout, struct syncstate *syns) { _______________________________________________ Xenomai-git mailing list [email protected] https://mail.gna.org/listinfo/xenomai-git
