* miscfuncs.cc (DEFAULT_STACKSIZE): Remove.
(CygwinCreateThread): Simplify code by assuming that now stack-related input values are undefined. Set stack protection to PAGE_READWRITE, as is default on Windows. Add lengthy comment to explain POSIX guardpage. * thread.cc (pthread_attr::pthread_attr): Initialize stacksize as PTHREAD_DEFAULT_STACKSIZE. Initialize guardsize as PTHREAD_DEFAULT_GUARDSIZE. * thread.h (PTHREAD_DEFAULT_STACKSIZE): Define. Add comment to explain. (PTHREAD_DEFAULT_GUARDSIZE): Define.
This commit is contained in:
@@ -16,6 +16,12 @@ details. */
|
||||
#define WRITE_LOCK 1
|
||||
#define READ_LOCK 2
|
||||
|
||||
/* Default is a 1 Megs stack with a 4K guardpage. Since the pthread stacksize
|
||||
does not include the guardpage size, but we don't want to waste another 64K,
|
||||
subtract the default guardpage size from the stacksize. */
|
||||
#define PTHREAD_DEFAULT_STACKSIZE (1024 * 1024 - wincap.page_size ())
|
||||
#define PTHREAD_DEFAULT_GUARDSIZE (wincap.page_size ())
|
||||
|
||||
#include <pthread.h>
|
||||
#include <limits.h>
|
||||
#include "security.h"
|
||||
|
Reference in New Issue
Block a user