From 7ecc5398994847668611529517ce0453d6b8f44b Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <randrianasulu@gmail.com>
Date: Mon, 28 Mar 2022 02:19:55 +0300
Subject: [PATCH 3/9] realtime prio only on linux and termux for now

---
 cinelerra-5.1/guicast/thread.C | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/cinelerra-5.1/guicast/thread.C b/cinelerra-5.1/guicast/thread.C
index 9908a628..edac1451 100644
--- a/cinelerra-5.1/guicast/thread.C
+++ b/cinelerra-5.1/guicast/thread.C
@@ -58,13 +58,15 @@ void* Thread::entrypoint(void *parameters)
 	pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
 	thread->cancel_enabled = false;
 
+// not on bsd
+#if defined (__linux__) || defined (__TERMUX__)
 // Set realtime here since it doesn't work in start
 	if( thread->realtime && getuid() == 0 ) {
 		struct sched_param param = { sched_priority : 1 };
 		if(pthread_setschedparam(thread->tid, SCHED_RR, &param) < 0)
 			perror("Thread::entrypoint pthread_attr_setschedpolicy");
 	}
-
+#endif
 	thread->run();
 	thread->finished = true;
 	if( !thread->synchronous ) {
-- 
2.35.1

