Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22668
Modified Files: Tag: devel_0_37 d_soundfile.c Log Message: handling scheduling priority
Index: d_soundfile.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/d_soundfile.c,v retrieving revision 1.1.1.2.2.28 retrieving revision 1.1.1.2.2.29 diff -C2 -d -r1.1.1.2.2.28 -r1.1.1.2.2.29 *** d_soundfile.c 23 Oct 2004 10:14:04 -0000 1.1.1.2.2.28 --- d_soundfile.c 23 Oct 2004 13:07:23 -0000 1.1.1.2.2.29 *************** *** 1052,1055 **** --- 1052,1057 ---- }
+ extern int sys_hipriority; /* real-time flag, true if priority boosted */ + /* create soundfiler thread */ void sys_start_sfthread(void) *************** *** 1079,1096 ****
#ifdef UNIX ! if (getuid() == 0) { sf_param.sched_priority=sched_get_priority_min(SCHED_RR); pthread_attr_setschedpolicy(&sf_attr,SCHED_RR); } ! ! /* we should be able use realtime scheduling if we're not root */ ! /* if (pthread_attr_setschedpolicy(&sf_attr,SCHED_RR) != ENOTSUP) */ ! /* sf_param.sched_priority=sched_get_priority_min(SCHED_RR); */ ! /* else */ ! /* { */ ! /* pthread_attr_setschedpolicy(&sf_attr,SCHED_OTHER); */ ! /* sf_param.sched_priority=sched_get_priority_min(SCHED_OTHER); */ ! /* } */ #endif /* UNIX */
--- 1081,1094 ----
#ifdef UNIX ! if (sys_hipriority) { sf_param.sched_priority=sched_get_priority_min(SCHED_RR); pthread_attr_setschedpolicy(&sf_attr,SCHED_RR); } ! else ! { ! pthread_attr_setschedpolicy(&sf_attr,SCHED_OTHER); ! sf_param.sched_priority=sched_get_priority_min(SCHED_OTHER); ! } #endif /* UNIX */
*************** *** 1100,1104 **** status = pthread_create(&sf_thread_id, &sf_attr, (void *) soundfiler_thread,NULL); ! if ( status !=0) error("Couldn't create soundfiler thread: %d",status); else --- 1098,1102 ---- status = pthread_create(&sf_thread_id, &sf_attr, (void *) soundfiler_thread,NULL); ! if (status != 0) error("Couldn't create soundfiler thread: %d",status); else