Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Message-Id: In-Reply-To: References: Date: Mon, 21 Oct 2013 16:09:31 +0200 From: Kim De Mey Subject: [Xenomai] [PATCH 1 of 3 v2] Xenomai-forge thread_obj: Do not set __THREAD_S_SAFE when not needed List-Id: Discussions about the Xenomai project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: xenomai@xenomai.org Do not set __THREAD_S_SAFE for thobj->status when the priority of the task is lower than the priority of the current task. Signed-off-by: Kim De Mey --- lib/copperplate/threadobj.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/lib/copperplate/threadobj.c b/lib/copperplate/threadobj.c --- a/lib/copperplate/threadobj.c +++ b/lib/copperplate/threadobj.c @@ -926,7 +926,7 @@ int threadobj_start(struct threadobj *th if (thobj->status & __THREAD_S_STARTED) return 0; - thobj->status |= __THREAD_S_STARTED|__THREAD_S_SAFE; + thobj->status |= __THREAD_S_STARTED; __RT(pthread_cond_signal(&thobj->barrier)); if (current && thobj->priority <= current->priority) @@ -943,6 +943,7 @@ int threadobj_start(struct threadobj *th */ pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &oldstate); + thobj->status |= __THREAD_S_SAFE; wait_on_barrier(thobj, __THREAD_S_ACTIVE); thobj->status &= ~__THREAD_S_SAFE;