Browse Source

is_true_threads() on win32 case

David Rose 15 years ago
parent
commit
c489fbeefc

+ 1 - 0
panda/src/pipeline/contextSwitch.h

@@ -40,6 +40,7 @@ typedef void ContextFunction(struct ThreadContext *from_context, void *);
 typedef void ThreadFunction(void *);
 
 extern const int needs_stack_prealloc;
+extern const int is_os_threads;
 
 /* Call this to fill in the appropriate values in context.  If
    needs_stack_prealloc (above) is true, the stack must already have

+ 1 - 0
panda/src/pipeline/contextSwitch_longjmp_src.c

@@ -17,6 +17,7 @@
    which is necessary if setcontext() is not available. */
 
 const int needs_stack_prealloc = 1;
+const int is_os_threads = 0;
 
 #if defined(_M_IX86) || defined(__i386__)
 /* Maybe we can implement our own setjmp/longjmp in assembly code.

+ 1 - 0
panda/src/pipeline/contextSwitch_ucontext_src.c

@@ -24,6 +24,7 @@
 #endif
 
 const int needs_stack_prealloc = 1;
+const int is_os_threads = 0;
 
 struct ThreadContext {
   ucontext_t _ucontext;

+ 1 - 0
panda/src/pipeline/contextSwitch_windows_src.c

@@ -26,6 +26,7 @@
 
 /* The Windows implementation doesn't use the stack pointer. */
 const int needs_stack_prealloc = 0;
+const int is_os_threads = 1;
 
 static struct ThreadContext *current_context = NULL;
 

+ 1 - 1
panda/src/pipeline/threadSimpleImpl.I

@@ -69,7 +69,7 @@ is_threading_supported() {
 ////////////////////////////////////////////////////////////////////
 INLINE bool ThreadSimpleImpl::
 is_true_threads() {
-  return false;
+  return (is_os_threads != 0);
 }
 
 ////////////////////////////////////////////////////////////////////