Mesa (lp-binning): gallium: comments and minor re-org in p_thread.h

Brian Paul brianp at kemper.freedesktop.org
Fri Dec 11 17:01:20 PST 2009


Module: Mesa
Branch: lp-binning
Commit: 24d894e5579bd11fdf294d86834093e353abf4db
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=24d894e5579bd11fdf294d86834093e353abf4db

Author: Brian Paul <brianp at vmware.com>
Date:   Fri Dec 11 14:07:01 2009 -0700

gallium: comments and minor re-org in p_thread.h

There's more work to do in this file:
1. Implement condvars for Windows via Win32 CONDITION_VARIABLE type.
2. Implement barriers for Windows
3. Try to get rid of PIPE_THREAD_HAVE_CONDVAR (only used in trace driver)
4. Why the 2 in _P_THREAD2_H_?

---

 src/gallium/include/pipe/p_thread.h |   40 +++++++++++++++++++++++++++++-----
 1 files changed, 34 insertions(+), 6 deletions(-)

diff --git a/src/gallium/include/pipe/p_thread.h b/src/gallium/include/pipe/p_thread.h
index ba5cd58..8119c1f 100644
--- a/src/gallium/include/pipe/p_thread.h
+++ b/src/gallium/include/pipe/p_thread.h
@@ -47,6 +47,8 @@
 
 #define PIPE_THREAD_HAVE_CONDVAR
 
+/* pipe_thread
+ */
 typedef pthread_t pipe_thread;
 
 #define PIPE_THREAD_ROUTINE( name, param ) \
@@ -70,8 +72,10 @@ static INLINE int pipe_thread_destroy( pipe_thread thread )
    return pthread_detach( thread );
 }
 
+
+/* pipe_mutex
+ */
 typedef pthread_mutex_t pipe_mutex;
-typedef pthread_cond_t pipe_condvar;
 
 #define pipe_static_mutex(mutex) \
    static pipe_mutex mutex = PTHREAD_MUTEX_INITIALIZER
@@ -88,6 +92,11 @@ typedef pthread_cond_t pipe_condvar;
 #define pipe_mutex_unlock(mutex) \
    (void) pthread_mutex_unlock(&(mutex))
 
+
+/* pipe_condvar
+ */
+typedef pthread_cond_t pipe_condvar;
+
 #define pipe_static_condvar(mutex) \
    static pipe_condvar mutex = PTHREAD_COND_INITIALIZER
 
@@ -107,6 +116,8 @@ typedef pthread_cond_t pipe_condvar;
   pthread_cond_broadcast(&(cond))
 
 
+/* pipe_barrier
+ */
 typedef pthread_barrier_t pipe_barrier;
 
 static INLINE void pipe_barrier_init(pipe_barrier *barrier, unsigned count)
@@ -129,6 +140,8 @@ static INLINE void pipe_barrier_wait(pipe_barrier *barrier)
 
 #include <windows.h>
 
+/* pipe_thread
+ */
 typedef HANDLE pipe_thread;
 
 #define PIPE_THREAD_ROUTINE( name, param ) \
@@ -154,6 +167,9 @@ static INLINE int pipe_thread_destroy( pipe_thread thread )
    return -1;
 }
 
+
+/* pipe_mutex
+ */
 typedef CRITICAL_SECTION pipe_mutex;
 
 #define pipe_static_mutex(mutex) \
@@ -171,17 +187,29 @@ typedef CRITICAL_SECTION pipe_mutex;
 #define pipe_mutex_unlock(mutex) \
    LeaveCriticalSection(&mutex)
 
-/* XXX: dummy definitions, make it compile */
 
+/* pipe_condvar (XXX FIX THIS)
+ */
 typedef unsigned pipe_condvar;
 
-#define pipe_condvar_init(condvar) \
-   (void) condvar
+#define pipe_condvar_init(cond) \
+   (void) cond
 
-#define pipe_condvar_broadcast(condvar) \
-   (void) condvar
+#define pipe_condvar_destroy(cond) \
+   (void) cond
+
+#define pipe_condvar_wait(cond, mutex) \
+   (void) cond; (void) mutex
+
+#define pipe_condvar_signal(cond) \
+   (void) cond
+
+#define pipe_condvar_broadcast(cond) \
+   (void) cond
 
 
+/* pipe_barrier (XXX FIX THIS)
+ */
 typedef unsigned pipe_barrier;
 
 static INLINE void pipe_barrier_init(pipe_barrier *barrier, unsigned count)



More information about the mesa-commit mailing list