summaryrefslogtreecommitdiff
path: root/audio/cheesetracker/patches/patch-ab
blob: 66ea4efdb83a89a4a9bcf00975a48e97b972f394 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
$NetBSD: patch-ab,v 1.2 2002/06/23 13:51:42 kent Exp $

--- program/cheesetracker.cpp.orig	Thu Apr 11 23:24:16 2002
+++ program/cheesetracker.cpp
@@ -186,12 +186,19 @@
 
 }
 
+gint pth_nbschedule(gint no_need_this) {
+	pthread_yield_np();
+	return 1;
+}
+
 
 int main(int argc, char *argv[]) {
 
 
 	pthread_attr_t thread_attr;
+#if !defined(_POSIX_THREAD_IS_GNU_PTH) || defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
         sched_param thread_sched_param;
+#endif
 
 	int tmperror,counter=0;
 	char * filename;
@@ -238,9 +245,19 @@
 	quit_player=false;
 
 	pthread_attr_init(&thread_attr);
+#if !defined(_POSIX_THREAD_IS_GNU_PTH) || defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
 	thread_sched_param.sched_priority=0;
         pthread_attr_setschedparam (&thread_attr,&thread_sched_param);
+#endif
 	pthread_create(&player_thread,&thread_attr,&player_thread_callback,NULL);
+
+#ifdef _POSIX_THREAD_IS_GNU_PTH
+	SigC::Slot0<gint> my_slot = SigC::bind(
+		SigC::slot(pth_nbschedule),
+		0);
+	Gtk::Connection conn = Gtk::Main::timeout.connect(my_slot, 150);
+#endif
+