[asterisk-scf-commits] asterisk-scf/release/pjproject.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Fri Jun 3 15:46:18 CDT 2011


branch "master" has been updated
       via  6360b96e03e5cf651d5b310f0303db101cd1832d (commit)
      from  101d37e6e300cf893c937fc9351bbdc67b129f4d (commit)

Summary of changes:
 pjlib/include/pj/config_site.h |   12 ++++++++++++
 pjlib/src/pj/os_core_win32.c   |    7 +++++++
 2 files changed, 19 insertions(+), 0 deletions(-)


- Log -----------------------------------------------------------------
commit 6360b96e03e5cf651d5b310f0303db101cd1832d
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Fri Jun 3 15:46:06 2011 -0500

    Moved alteration of a thread's default stack size into config_site.h

diff --git a/pjlib/include/pj/config_site.h b/pjlib/include/pj/config_site.h
index c0a3391..8d63684 100644
--- a/pjlib/include/pj/config_site.h
+++ b/pjlib/include/pj/config_site.h
@@ -16,6 +16,18 @@
 #undef  _WIN32_WINNT
 #define _WIN32_WINNT   PJ_WIN32_WINNT
 
+#ifdef PJ_THREAD_DEFAULT_STACK_SIZE
+#undef PJ_THREAD_DEFAULT_STACK_SIZE
 #endif
 
+// We're going to assume that we need twice the default stack
+// size for Windows since we're targetting 64-bit platforms.  
+// This is a temporary fix until we refactor the thread code
+// to use beginthreadex(...) instead of CreateThread(...) for
+// Windows threads. 
+#define PJ_THREAD_DEFAULT_STACK_SIZE 16384
+
+#endif  // PJ_WIN32
+
+
 
diff --git a/pjlib/src/pj/os_core_win32.c b/pjlib/src/pj/os_core_win32.c
index 387d79c..0c43fd2 100644
--- a/pjlib/src/pj/os_core_win32.c
+++ b/pjlib/src/pj/os_core_win32.c
@@ -605,11 +605,18 @@ PJ_DEF(pj_status_t) pj_thread_sleep(unsigned msec)
 PJ_DEF(void) pj_thread_check_stack(const char *file, int line)
 {
     char stk_ptr;
+    unsigned long stk_start;
+    unsigned long std_ptr_addr;
+    unsigned long stk_size;
     pj_uint32_t usage;
     pj_thread_t *thread = pj_thread_this();
 
     pj_assert(thread);
 
+    std_ptr_addr = (unsigned long)&stk_ptr;
+    stk_start = (unsigned long)thread->stk_start;
+    stk_size = (unsigned long)thread->stk_size;
+
     /* Calculate current usage. */
     usage = (&stk_ptr > thread->stk_start) ? &stk_ptr - thread->stk_start :
 		thread->stk_start - &stk_ptr;

-----------------------------------------------------------------------


-- 
asterisk-scf/release/pjproject.git



More information about the asterisk-scf-commits mailing list