eina_thread: non-linux fixes following latest changes
This commit is contained in:
parent
14b2ba7bed
commit
8f62e4f7ce
|
@ -56,6 +56,9 @@ pthread_barrier_init(&barrier, NULL, 1);
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
|
#ifndef __linux__
|
||||||
|
#include <pthread_np.h>
|
||||||
|
#endif
|
||||||
]],
|
]],
|
||||||
[[
|
[[
|
||||||
pthread_attr_setaffinity_np(NULL, 0, NULL);
|
pthread_attr_setaffinity_np(NULL, 0, NULL);
|
||||||
|
@ -67,9 +70,16 @@ pthread_attr_setaffinity_np(NULL, 0, NULL);
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
#ifndef __linux__
|
||||||
|
#include <pthread_np.h>
|
||||||
|
#endif
|
||||||
]],
|
]],
|
||||||
[[
|
[[
|
||||||
|
#ifndef __linux__
|
||||||
|
pthread_set_name_np(NULL, NULL);
|
||||||
|
#else
|
||||||
pthread_setname_np(NULL, NULL);
|
pthread_setname_np(NULL, NULL);
|
||||||
|
#endif
|
||||||
]])],
|
]])],
|
||||||
[efl_have_setname="yes"],
|
[efl_have_setname="yes"],
|
||||||
[efl_have_setname="no"])
|
[efl_have_setname="no"])
|
||||||
|
|
|
@ -35,6 +35,13 @@
|
||||||
# include <pthread.h>
|
# include <pthread.h>
|
||||||
# include <errno.h>
|
# include <errno.h>
|
||||||
|
|
||||||
|
#ifdef EINA_HAVE_PTHREAD_AFFINITY
|
||||||
|
#ifndef __linux__
|
||||||
|
#include <pthread_np.h>
|
||||||
|
#define cpu_set_t cpuset_t
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
static inline void *
|
static inline void *
|
||||||
_eina_thread_join(Eina_Thread t)
|
_eina_thread_join(Eina_Thread t)
|
||||||
{
|
{
|
||||||
|
@ -181,7 +188,15 @@ eina_thread_name_set(Eina_Thread t, const char *name)
|
||||||
buf[15] = 0;
|
buf[15] = 0;
|
||||||
}
|
}
|
||||||
else buf[0] = 0;
|
else buf[0] = 0;
|
||||||
|
#ifndef __linux__
|
||||||
|
pthread_set_name_np((pthread_t)t, buf);
|
||||||
|
return EINA_TRUE;
|
||||||
|
#else
|
||||||
if (pthread_setname_np((pthread_t)t, buf) == 0) return EINA_TRUE;
|
if (pthread_setname_np((pthread_t)t, buf) == 0) return EINA_TRUE;
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
(void)t;
|
||||||
|
(void)name;
|
||||||
#endif
|
#endif
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue