You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2024/10/11 11:32:33 UTC

(nuttx-apps) branch master updated: osperf/osperf: move close pipefd after pthread_join

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new 6ea8f70ca osperf/osperf: move close pipefd after pthread_join
6ea8f70ca is described below

commit 6ea8f70ca832785511fec8cc2098462591554389
Author: Bowen Wang <wa...@xiaomi.com>
AuthorDate: Wed Jun 5 10:24:15 2024 +0800

    osperf/osperf: move close pipefd after pthread_join
    
    Avoid the new thread write the closed pipe
    
    Signed-off-by: Bowen Wang <wa...@xiaomi.com>
---
 benchmarks/osperf/osperf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/benchmarks/osperf/osperf.c b/benchmarks/osperf/osperf.c
index e4b69827c..54a578f25 100644
--- a/benchmarks/osperf/osperf.c
+++ b/benchmarks/osperf/osperf.c
@@ -281,9 +281,9 @@ static size_t poll_performance(void)
   poll(&fds, 1, -1);
   performance_end(&result);
 
+  pthread_join(ret, NULL);
   close(pipefd[0]);
   close(pipefd[1]);
-  pthread_join(ret, NULL);
   return performance_gettime(&result);
 }