From 2da6dfd8421965c3a29fcc3ec0975bf1e4021d51 Mon Sep 17 00:00:00 2001 From: Damian Wrobel Date: Sat, 23 May 2020 12:21:00 +0200 Subject: [PATCH] Remove unused thread_lock Signed-off-by: Damian Wrobel --- src/rtapi/uspace_rtapi_app.cc | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/rtapi/uspace_rtapi_app.cc b/src/rtapi/uspace_rtapi_app.cc index 69a71e69b67..b8ad13a248d 100644 --- a/src/rtapi/uspace_rtapi_app.cc +++ b/src/rtapi/uspace_rtapi_app.cc @@ -598,10 +598,8 @@ struct PosixTask : rtapi_task struct Posix : RtapiApp { - Posix(int policy = SCHED_FIFO) : RtapiApp(policy), do_thread_lock(policy != SCHED_FIFO) { + Posix(int policy = SCHED_FIFO) : RtapiApp(policy) { pthread_once(&key_once, init_key); - if(do_thread_lock) - pthread_mutex_init(&thread_lock, 0); } int task_delete(int id); int task_start(int task_id, unsigned long period_nsec); @@ -618,8 +616,6 @@ struct Posix : RtapiApp void do_outb(unsigned char value, unsigned int port); int run_threads(int fd, int (*callback)(int fd)); static void *wrapper(void *arg); - bool do_thread_lock; - pthread_mutex_t thread_lock; static pthread_once_t key_once; static pthread_key_t key; @@ -1041,10 +1037,6 @@ void *Posix::wrapper(void *arg) pthread_setspecific(key, arg); - Posix &papp = reinterpret_cast(App()); - if(papp.do_thread_lock) - pthread_mutex_lock(&papp.thread_lock); - struct timespec now; clock_gettime(RTAPI_CLOCK, &now); rtapi_timespec_advance(task->nextstart, now, task->period + task->pll_correction); @@ -1086,8 +1078,6 @@ int Posix::task_self() { } void Posix::wait() { - if(do_thread_lock) - pthread_mutex_unlock(&thread_lock); pthread_testcancel(); struct rtapi_task *task = reinterpret_cast(pthread_getspecific(key)); rtapi_timespec_advance(task->nextstart, task->nextstart, task->period + task->pll_correction); @@ -1103,8 +1093,6 @@ void Posix::wait() { int res = rtapi_clock_nanosleep(RTAPI_CLOCK, TIMER_ABSTIME, &task->nextstart, nullptr, &now); if(res < 0) perror("clock_nanosleep"); } - if(do_thread_lock) - pthread_mutex_lock(&thread_lock); } unsigned char Posix::do_inb(unsigned int port)