Initial import of cheesetracker-0.2.1, an ImpulsTracker clone. This
[pkgsrc.git] / audio / cheesetracker / patches / patch-ab
1 $NetBSD$
2
3 --- src/main.cpp.orig   Wed May  9 06:43:01 2001
4 +++ src/main.cpp        Thu Jun 14 23:25:55 2001
5 @@ -78,6 +78,10 @@
6         return NULL;
7  }
8  
9 +gint pth_nbschedule(gint no_need_this) {
10 +       pthread_yield_np();
11 +       return 1;
12 +}
13  
14  void initialize_objects () {
15  
16 @@ -145,7 +149,9 @@
17  
18  
19         pthread_attr_t thread_attr;
20 +#if !defined(_POSIX_THREAD_IS_GNU_PTH) || defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
21          sched_param thread_sched_param;
22 +#endif
23  
24         int tmperror,counter=0;
25         char * filename;
26 @@ -182,9 +188,18 @@
27         quit_player=false;
28  
29         pthread_attr_init(&thread_attr);
30 +#if !defined(_POSIX_THREAD_IS_GNU_PTH) || defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
31         thread_sched_param.sched_priority=0;
32          pthread_attr_setschedparam (&thread_attr,&thread_sched_param);
33 +#endif
34         pthread_create(&player_thread,&thread_attr,&player_thread_callback,NULL);
35 +
36 +#ifdef _POSIX_THREAD_IS_GNU_PTH
37 +       SigC::Slot0<gint> my_slot = SigC::bind(
38 +               SigC::slot(pth_nbschedule),
39 +               0);
40 +       Gtk::Connection conn = Gtk::Main::timeout.connect(my_slot, 150);
41 +#endif
42  
43         begin_threads=true;
44