#include <string.h>
#include <typeinfo>
#include "thread.h"
+#if defined(__TERMUX__)
+#include "bthread.h"
+#endif
Thread::Thread(int synchronous, int realtime, int autodelete)
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
thread->cancel_enabled = false;
-// Set realtime here seince it doesn't work in start
+// 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::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