diff options
author | Emanuel Hoogeveen <emanuel.hoogeveen@gmail.com> | 2014-01-28 10:40:26 -0800 |
---|---|---|
committer | Emanuel Hoogeveen <emanuel.hoogeveen@gmail.com> | 2014-01-28 10:40:26 -0800 |
commit | 4cbdf99e54ac102cc96a192c54ec502015940e0e (patch) | |
tree | 7b2d9311d68707bebb05cd3bb09e9ec2e39743ed | |
parent | a726685b70564cfb6f31f20ffbd21fe7f58df0f9 (diff) | |
download | nspr-hg-NSPR_4_10_4_BETA2.tar.gz |
Bug 958796: Pass STACK_SIZE_PARAM_IS_A_RESERVATION to _beginthreadexNSPR_4_10_4_BETA2
when setting a custom thread stack size. r=wtc.
-rw-r--r-- | pr/src/md/windows/ntthread.c | 2 | ||||
-rw-r--r-- | pr/src/md/windows/w95thred.c | 2 | ||||
-rw-r--r-- | pr/tests/attach.c | 2 | ||||
-rw-r--r-- | pr/tests/foreign.c | 4 | ||||
-rw-r--r-- | pr/tests/provider.c | 2 | ||||
-rw-r--r-- | pr/tests/socket.c | 2 | ||||
-rw-r--r-- | pr/tests/testfile.c | 2 |
7 files changed, 7 insertions, 9 deletions
diff --git a/pr/src/md/windows/ntthread.c b/pr/src/md/windows/ntthread.c index 3814142d..fead1236 100644 --- a/pr/src/md/windows/ntthread.c +++ b/pr/src/md/windows/ntthread.c @@ -182,7 +182,7 @@ _PR_MD_CREATE_THREAD(PRThread *thread, thread->stack->stackSize, pr_root, (void *)thread, - CREATE_SUSPENDED, + CREATE_SUSPENDED | STACK_SIZE_PARAM_IS_A_RESERVATION, &(thread->id)); if(!thread->md.handle) { PRErrorCode prerror; diff --git a/pr/src/md/windows/w95thred.c b/pr/src/md/windows/w95thred.c index be92e208..932c50c3 100644 --- a/pr/src/md/windows/w95thred.c +++ b/pr/src/md/windows/w95thred.c @@ -106,7 +106,7 @@ _PR_MD_CREATE_THREAD(PRThread *thread, thread->stack->stackSize, pr_root, (void *)thread, - CREATE_SUSPENDED, + CREATE_SUSPENDED | STACK_SIZE_PARAM_IS_A_RESERVATION, &(thread->id)); if(!thread->md.handle) { return PR_FAILURE; diff --git a/pr/tests/attach.c b/pr/tests/attach.c index e0ae9dd2..a5daf9d9 100644 --- a/pr/tests/attach.c +++ b/pr/tests/attach.c @@ -260,7 +260,7 @@ int main(int argc, char **argv) #elif defined(WIN32) hThread = (HANDLE) _beginthreadex(NULL, 0, threadStartFunc, NULL, - 0, &threadID); + STACK_SIZE_PARAM_IS_A_RESERVATION, &threadID); if (hThread == 0) { fprintf(stderr, "thread creation failed: error code %d\n", GetLastError()); diff --git a/pr/tests/foreign.c b/pr/tests/foreign.c index d5be90a5..637f419d 100644 --- a/pr/tests/foreign.c +++ b/pr/tests/foreign.c @@ -79,9 +79,7 @@ static void sproc_start(void *arg, PRSize size) #endif /* defined(IRIX) && !defined(_PR_PTHREADS) */ #if defined(WIN32) -#if defined(WINCE) #include <windows.h> -#endif #include <process.h> /* for _beginthreadex() */ static PRUintn __stdcall windows_start(void *arg) @@ -174,7 +172,7 @@ static PRStatus NSPRPUB_TESTS_CreateThread(StartFn start, void *arg) 0U, /* DWORD - initial thread stack size, in bytes */ windows_start, /* LPTHREAD_START_ROUTINE - pointer to thread function */ start_object, /* LPVOID - argument for new thread */ - 0U, /*DWORD dwCreationFlags - creation flags */ + STACK_SIZE_PARAM_IS_A_RESERVATION, /*DWORD dwCreationFlags - creation flags */ &id /* LPDWORD - pointer to returned thread identifier */ ); rv = (NULL == th) ? PR_FAILURE : PR_SUCCESS; diff --git a/pr/tests/provider.c b/pr/tests/provider.c index c62387a2..0e6569d6 100644 --- a/pr/tests/provider.c +++ b/pr/tests/provider.c @@ -753,7 +753,7 @@ static PRStatus NewThread( 0U, /* DWORD - initial thread stack size, in bytes */ windows_start, /* LPTHREAD_START_ROUTINE - pointer to thread function */ start_object, /* LPVOID - argument for new thread */ - 0U, /*DWORD dwCreationFlags - creation flags */ + STACK_SIZE_PARAM_IS_A_RESERVATION, /*DWORD dwCreationFlags - creation flags */ &id /* LPDWORD - pointer to returned thread identifier */ ); rv = (NULL == th) ? PR_FAILURE : PR_SUCCESS; diff --git a/pr/tests/socket.c b/pr/tests/socket.c index 7664c0c0..3544ba5e 100644 --- a/pr/tests/socket.c +++ b/pr/tests/socket.c @@ -347,7 +347,7 @@ PRInt32 native_thread = 0; stackSize, (unsigned (__stdcall *)(void *))start, arg, - 0, + STACK_SIZE_PARAM_IS_A_RESERVATION, &tid); return((PRThread *) thandle); #endif diff --git a/pr/tests/testfile.c b/pr/tests/testfile.c index 6846e3b8..b5f07fa5 100644 --- a/pr/tests/testfile.c +++ b/pr/tests/testfile.c @@ -150,7 +150,7 @@ PRInt32 native_thread = 0; stackSize, (unsigned (__stdcall *)(void *))start, arg, - 0, + STACK_SIZE_PARAM_IS_A_RESERVATION, &tid); return((PRThread *) thandle); #endif |