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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Thu Sep 25 15:18:53 2014 +0200

lib/cobalt/printf: flush buffers on exit

---

 lib/cobalt/printf.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/lib/cobalt/printf.c b/lib/cobalt/printf.c
index 920ae25..e391f96 100644
--- a/lib/cobalt/printf.c
+++ b/lib/cobalt/printf.c
@@ -511,12 +511,9 @@ const char *rt_print_buffer_name(void)
 /* *** Deferred Output Management *** */
 void rt_print_flush_buffers(void)
 {
-       assert_nrt();
-
+       cobalt_thread_relax();
        pthread_mutex_lock(&buffer_lock);
-
        print_buffers();
-
        pthread_mutex_unlock(&buffer_lock);
 }
 
@@ -797,6 +794,7 @@ void cobalt_print_init(void)
        pthread_atfork(NULL, NULL, forked_child_init);
 
        rt_print_auto_init(1);
+       atexit(rt_print_flush_buffers);
 }
 
 void cobalt_print_exit(void)


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

Reply via email to