eina_thread: check if pthread_getschedparam fails 64/263164/1 accepted/tizen/unified/20210901.103715 submit/tizen/20210830.054133 submit/tizen/20210831.021621
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Fri, 27 Aug 2021 05:55:15 +0000 (14:55 +0900)
committerJaehyun Cho <jae_hyun.cho@samsung.com>
Fri, 27 Aug 2021 05:55:15 +0000 (14:55 +0900)
The return value of pthread_getschedparam is checked to know if it
fails.

Change-Id: Idef27abcdfc2de0dfcf6e746edaf2230258c3eed

src/lib/eina/eina_thread.c

index 18e7ac5..9dde953 100644 (file)
@@ -154,7 +154,11 @@ _eina_internal_call(void *context)
         int pol = SCHED_IDLE;
 #else
         int pol;
-        pthread_getschedparam(self, &pol, &params);
+        int err = pthread_getschedparam(self, &pol, &params);
+        if (err != 0)
+          {
+             EINA_LOG_ERR("pthread_getschedparam failed: %d", err);
+          }
 #endif
         min = sched_get_priority_min(pol);
         params.sched_priority = min;
@@ -168,7 +172,11 @@ _eina_internal_call(void *context)
         int pol = SCHED_BATCH;
 #else
         int pol;
-        pthread_getschedparam(self, &pol, &params);
+        int err = pthread_getschedparam(self, &pol, &params);
+        if (err != 0)
+          {
+             EINA_LOG_ERR("pthread_getschedparam failed: %d", err);
+          }
 #endif
         min = sched_get_priority_min(pol);
         max = sched_get_priority_max(pol);
@@ -183,8 +191,11 @@ _eina_internal_call(void *context)
      {
         struct sched_param params;
         int max, pol;
-
-        pthread_getschedparam(self, &pol, &params);
+        int err = pthread_getschedparam(self, &pol, &params);
+        if (err != 0)
+          {
+             EINA_LOG_ERR("pthread_getschedparam failed: %d", err);
+          }
         max = sched_get_priority_max(pol);
         params.sched_priority += 5;
         if (params.sched_priority > max) params.sched_priority = max;