From c489fbeefc73dd6a34ff45009bf23c1f97c7b94c Mon Sep 17 00:00:00 2001 From: David Rose Date: Wed, 28 Apr 2010 18:22:46 +0000 Subject: [PATCH] is_true_threads() on win32 case --- panda/src/pipeline/contextSwitch.h | 1 + panda/src/pipeline/contextSwitch_longjmp_src.c | 1 + panda/src/pipeline/contextSwitch_ucontext_src.c | 1 + panda/src/pipeline/contextSwitch_windows_src.c | 1 + panda/src/pipeline/threadSimpleImpl.I | 2 +- 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/panda/src/pipeline/contextSwitch.h b/panda/src/pipeline/contextSwitch.h index 5262a5f8a2..f475b9781c 100644 --- a/panda/src/pipeline/contextSwitch.h +++ b/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 diff --git a/panda/src/pipeline/contextSwitch_longjmp_src.c b/panda/src/pipeline/contextSwitch_longjmp_src.c index 3dd444b198..c3640b8f1f 100755 --- a/panda/src/pipeline/contextSwitch_longjmp_src.c +++ b/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. diff --git a/panda/src/pipeline/contextSwitch_ucontext_src.c b/panda/src/pipeline/contextSwitch_ucontext_src.c index fdbfe84436..f589dbb5bf 100755 --- a/panda/src/pipeline/contextSwitch_ucontext_src.c +++ b/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; diff --git a/panda/src/pipeline/contextSwitch_windows_src.c b/panda/src/pipeline/contextSwitch_windows_src.c index c38a543461..bf13c13344 100755 --- a/panda/src/pipeline/contextSwitch_windows_src.c +++ b/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; diff --git a/panda/src/pipeline/threadSimpleImpl.I b/panda/src/pipeline/threadSimpleImpl.I index 3bedc3d74c..47a88580a6 100644 --- a/panda/src/pipeline/threadSimpleImpl.I +++ b/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); } ////////////////////////////////////////////////////////////////////