forked from enlightenment/efl
Eina: Implement eina_sched_prio_drop() on Windows
SVN revision: 59637
This commit is contained in:
parent
5a886f7c30
commit
9f2ac8d7e3
|
@ -85,3 +85,7 @@
|
||||||
2011-05-18 Cedric Bail
|
2011-05-18 Cedric Bail
|
||||||
|
|
||||||
* Fix eina_share_common_init to be called only once.
|
* Fix eina_share_common_init to be called only once.
|
||||||
|
|
||||||
|
2011-05-24 Vincent Torri
|
||||||
|
|
||||||
|
* Implement eina_sched_prio_drop() on Windows
|
||||||
|
|
|
@ -30,6 +30,14 @@
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef EFL_HAVE_WIN32_THREADS
|
||||||
|
# ifndef WIN32_LEAN_AND_MEAN
|
||||||
|
# define WIN32_LEAN_AND_MEAN
|
||||||
|
# endif
|
||||||
|
# include <windows.h>
|
||||||
|
# undef WIN32_LEAN_AND_MEAN
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "eina_sched.h"
|
#include "eina_sched.h"
|
||||||
#include "eina_log.h"
|
#include "eina_log.h"
|
||||||
|
|
||||||
|
@ -76,6 +84,22 @@ eina_sched_prio_drop(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# endif
|
# 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))
|
||||||
|
EINA_LOG_ERR("Can not set thread priority");
|
||||||
|
|
||||||
|
CloseHandle(thread);
|
||||||
#else
|
#else
|
||||||
EINA_LOG_ERR("Eina does not have support for threads enabled"
|
EINA_LOG_ERR("Eina does not have support for threads enabled"
|
||||||
"or it doesn't support setting scheduler priorities");
|
"or it doesn't support setting scheduler priorities");
|
||||||
|
|
Loading…
Reference in New Issue