Eina : eina_sched.c : simpler code on Windows
authorVincent Torri <vincent.torri@gmail.com>
Wed, 1 Jun 2011 06:12:55 +0000 (06:12 +0000)
committerVincent Torri <vincent.torri@gmail.com>
Wed, 1 Jun 2011 06:12:55 +0000 (06:12 +0000)
SVN revision: 59856

legacy/eina/src/lib/eina_sched.c

index 45fcc00..8c7f7fe 100644 (file)
@@ -85,21 +85,8 @@ eina_sched_prio_drop(void)
      }
 # endif
 #elif defined EFL_HAVE_WIN32_THREADS
-   HANDLE thread;
-
-   thread = OpenThread(THREAD_SET_INFORMATION,
-                      FALSE,
-                      GetCurrentThreadId());
-   if (!thread)
-     {
-       EINA_LOG_ERR("Can not open current thread");
-       return;
-     }
-
-   if (!SetThreadPriority(thread, THREAD_PRIORITY_BELOW_NORMAL))
+   if (!SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_BELOW_NORMAL))
      EINA_LOG_ERR("Can not set thread priority");
-
-   CloseHandle(thread);
 #else
    EINA_LOG_ERR("Eina does not have support for threads enabled"
                 "or it doesn't support setting scheduler priorities");