X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fguicast%2Fthread.C;h=edac145110e8e8d978d203656b80a8c0bf2847f7;hb=refs%2Fheads%2Fmaster;hp=50b52a47cc52069f5becc3c37d189757884aaee1;hpb=5076ae5e37fc62ee1464855b59d678fb7e6f7bd0;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/guicast/thread.C b/cinelerra-5.1/guicast/thread.C index 50b52a47..edac1451 100644 --- a/cinelerra-5.1/guicast/thread.C +++ b/cinelerra-5.1/guicast/thread.C @@ -28,6 +28,9 @@ #include #include #include "thread.h" +#if defined(__TERMUX__) +#include "bthread.h" +#endif Thread::Thread(int synchronous, int realtime, int autodelete) @@ -55,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, ¶m) < 0) perror("Thread::entrypoint pthread_attr_setschedpolicy"); } - +#endif thread->run(); thread->finished = true; if( !thread->synchronous ) { @@ -102,8 +107,10 @@ void Thread::start() perror("Thread::start pthread_attr_setschedparam"); } else { +#if !defined(__TERMUX__) if(pthread_attr_setinheritsched(&attr, PTHREAD_INHERIT_SCHED) < 0) perror("Thread::start pthread_attr_setinheritsched"); +#endif } // autodelete may delete this immediately after create