changeset 172:08d65e21e357 trunk

[svn] Use GThread instead of pthread.
author chainsaw
date Sun, 13 Nov 2005 12:33:37 -0800
parents bfc3c7ff9d99
children 56c3a95b0bde
files Plugins/Input/tonegen/tonegen.c
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/Plugins/Input/tonegen/tonegen.c	Sun Nov 13 12:30:00 2005 -0800
+++ b/Plugins/Input/tonegen/tonegen.c	Sun Nov 13 12:33:37 2005 -0800
@@ -22,7 +22,6 @@
 #include "config.h"
 #include <glib.h>
 #include <stdlib.h>
-#include <pthread.h>
 #include <string.h>
 #include <math.h>
 #include <stdio.h>
@@ -40,7 +39,7 @@
 
 static gboolean going;
 static gboolean audio_error;
-static pthread_t play_thread;
+static GThread *play_thread;
 
 static void tone_about(void)
 {
@@ -120,7 +119,7 @@
 	tone_ip.output->buffer_free();
 	tone_ip.output->buffer_free();
 
-	pthread_exit(NULL);
+	g_thread_exit(NULL);
 }
 
 static GArray* tone_filename_parse(const char* filename)
@@ -198,7 +197,7 @@
 	name = tone_title(filename);
 	tone_ip.set_info(name, -1, 16 * OUTPUT_FREQ, OUTPUT_FREQ, 1);
 	g_free(name);
-	pthread_create(&play_thread, NULL, play_loop, frequencies);
+	play_thread = g_thread_create((GThreadFunc)play_loop, frequencies, TRUE, NULL);
 }
 
 static void tone_stop(void)
@@ -206,7 +205,7 @@
 	if (going)
 	{
 		going = FALSE;
-		pthread_join(play_thread, NULL);
+		g_thread_join(play_thread);
 		tone_ip.output->close_audio();
 	}
 }