[pulseaudio-commits] r1388 - /trunk/src/tests/thread-test.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Sat Sep 9 16:54:56 PDT 2006


Author: lennart
Date: Sun Sep 10 01:54:56 2006
New Revision: 1388

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1388&root=pulseaudio&view=rev
Log:
add pa_once testing code

Modified:
    trunk/src/tests/thread-test.c

Modified: trunk/src/tests/thread-test.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/tests/thread-test.c?rev=1388&root=pulseaudio&r1=1387&r2=1388&view=diff
==============================================================================
--- trunk/src/tests/thread-test.c (original)
+++ trunk/src/tests/thread-test.c Sun Sep 10 01:54:56 2006
@@ -25,6 +25,7 @@
 
 #include <pulsecore/thread.h>
 #include <pulsecore/mutex.h>
+#include <pulsecore/once.h>
 #include <pulsecore/log.h>
 #include <pulsecore/core-util.h>
 #include <pulse/xmalloc.h>
@@ -36,6 +37,12 @@
 static int magic_number = 0;
 
 #define THREADS_MAX 20
+
+static void once_func(void) {
+    pa_log("once!");
+}
+
+static pa_once_t once = PA_ONCE_INIT;
 
 static void thread_func(void *data) {
     pa_tls_set(tls, data);
@@ -64,6 +71,8 @@
         magic_number = 0;
 
         pa_mutex_unlock(mutex);
+
+        pa_once(&once, once_func);
 
         pa_cond_signal(cond2, 0);
         




More information about the pulseaudio-commits mailing list