projects
/
mesa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into asm-shader-rework-2
[mesa.git]
/
src
/
gallium
/
include
/
pipe
/
p_thread.h
diff --git
a/src/gallium/include/pipe/p_thread.h
b/src/gallium/include/pipe/p_thread.h
index 8af3cd958b0a318c1f571575c592fea2be6aa24f..b1606dc6526bf09a4dc262f67d3c3505d56bc5bb 100644
(file)
--- a/
src/gallium/include/pipe/p_thread.h
+++ b/
src/gallium/include/pipe/p_thread.h
@@
-36,13
+36,16
@@
#include "pipe/p_compiler.h"
#include "pipe/p_compiler.h"
+#include "util/u_debug.h" /* for assert */
-#if defined(PIPE_OS_LINUX)
+#if defined(PIPE_OS_LINUX)
|| defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_HAIKU)
#include <pthread.h> /* POSIX threads headers */
#include <stdio.h> /* for perror() */
#include <pthread.h> /* POSIX threads headers */
#include <stdio.h> /* for perror() */
+#define PIPE_THREAD_HAVE_CONDVAR
+
typedef pthread_t pipe_thread;
#define PIPE_THREAD_ROUTINE( name, param ) \
typedef pthread_t pipe_thread;
#define PIPE_THREAD_ROUTINE( name, param ) \
@@
-73,7
+76,7
@@
typedef pthread_cond_t pipe_condvar;
static pipe_mutex mutex = PTHREAD_MUTEX_INITIALIZER
#define pipe_mutex_init(mutex) \
static pipe_mutex mutex = PTHREAD_MUTEX_INITIALIZER
#define pipe_mutex_init(mutex) \
- pthread_mutex_init(&(mutex), NULL)
+
(void)
pthread_mutex_init(&(mutex), NULL)
#define pipe_mutex_destroy(mutex) \
pthread_mutex_destroy(&(mutex))
#define pipe_mutex_destroy(mutex) \
pthread_mutex_destroy(&(mutex))
@@
-134,20
+137,20
@@
static INLINE int pipe_thread_destroy( pipe_thread thread )
typedef CRITICAL_SECTION pipe_mutex;
typedef CRITICAL_SECTION pipe_mutex;
-#define pipe_static_mutex(
name
) \
- /*static*/ pipe_mutex
name
= {0,0,0,0,0,0}
+#define pipe_static_mutex(
mutex
) \
+ /*static*/ pipe_mutex
mutex
= {0,0,0,0,0,0}
-#define pipe_mutex_init(
name
) \
- InitializeCriticalSection(&
name
)
+#define pipe_mutex_init(
mutex
) \
+ InitializeCriticalSection(&
mutex
)
-#define pipe_mutex_destroy(
name
) \
- DeleteCriticalSection(&
name
)
+#define pipe_mutex_destroy(
mutex
) \
+ DeleteCriticalSection(&
mutex
)
-#define pipe_mutex_lock(
name
) \
- EnterCriticalSection(&
name
)
+#define pipe_mutex_lock(
mutex
) \
+ EnterCriticalSection(&
mutex
)
-#define pipe_mutex_unlock(
name
) \
- LeaveCriticalSection(&
name
)
+#define pipe_mutex_unlock(
mutex
) \
+ LeaveCriticalSection(&
mutex
)
/* XXX: dummy definitions, make it compile */
/* XXX: dummy definitions, make it compile */
@@
-210,7
+213,7
@@
typedef unsigned pipe_condvar;
*/
typedef struct {
*/
typedef struct {
-#if defined(PIPE_OS_LINUX)
+#if defined(PIPE_OS_LINUX)
|| defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_HAIKU)
pthread_key_t key;
#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER)
DWORD key;
pthread_key_t key;
#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER)
DWORD key;
@@
-225,7
+228,7
@@
typedef struct {
static INLINE void
pipe_tsd_init(pipe_tsd *tsd)
{
static INLINE void
pipe_tsd_init(pipe_tsd *tsd)
{
-#if defined(PIPE_OS_LINUX)
+#if defined(PIPE_OS_LINUX)
|| defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_HAIKU)
if (pthread_key_create(&tsd->key, NULL/*free*/) != 0) {
perror("pthread_key_create(): failed to allocate key for thread specific data");
exit(-1);
if (pthread_key_create(&tsd->key, NULL/*free*/) != 0) {
perror("pthread_key_create(): failed to allocate key for thread specific data");
exit(-1);
@@
-242,7
+245,7
@@
pipe_tsd_get(pipe_tsd *tsd)
if (tsd->initMagic != (int) PIPE_TSD_INIT_MAGIC) {
pipe_tsd_init(tsd);
}
if (tsd->initMagic != (int) PIPE_TSD_INIT_MAGIC) {
pipe_tsd_init(tsd);
}
-#if defined(PIPE_OS_LINUX)
+#if defined(PIPE_OS_LINUX)
|| defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_HAIKU)
return pthread_getspecific(tsd->key);
#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER)
assert(0);
return pthread_getspecific(tsd->key);
#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER)
assert(0);
@@
-259,7
+262,7
@@
pipe_tsd_set(pipe_tsd *tsd, void *value)
if (tsd->initMagic != (int) PIPE_TSD_INIT_MAGIC) {
pipe_tsd_init(tsd);
}
if (tsd->initMagic != (int) PIPE_TSD_INIT_MAGIC) {
pipe_tsd_init(tsd);
}
-#if defined(PIPE_OS_LINUX)
+#if defined(PIPE_OS_LINUX)
|| defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_HAIKU)
if (pthread_setspecific(tsd->key, value) != 0) {
perror("pthread_set_specific() failed");
exit(-1);
if (pthread_setspecific(tsd->key, value) != 0) {
perror("pthread_set_specific() failed");
exit(-1);