# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1342727195 0 # Node ID a532ca0231ad115cb39afa27dfe76684eecf8c9a # Parent d1f65efea6b1af843465bf24fdf3e19c38870806 Attempt at fixing the issue noted in the last commit. Seems the issue is stack related using VAC3.6... We are supposed to allocate the stack in 4K blocks on OS/2, so clamp the requested amount to a multiple of 4K that is at least as big as the amount requested. diff -r d1f65efea6b1 -r a532ca0231ad os2/dw.c --- a/os2/dw.c Thu Jul 19 09:25:13 2012 +0000 +++ b/os2/dw.c Thu Jul 19 19:46:35 2012 +0000 @@ -11623,12 +11623,19 @@ */ DWTID API dw_thread_new(void *func, void *data, int stack) { - void **tmp = malloc(sizeof(void *) * 2); - - tmp[0] = func; - tmp[1] = data; - - return (DWTID)_beginthread((void (*)(void *))_dwthreadstart, NULL, stack, (void *)tmp); + void **tmp = malloc(sizeof(void *) * 2); + int z = 1; + + /* Clamp the stack size to 4K blocks... + * since some CRTs require it (VAC) + */ + while(stack > (4096*z)) + z++; + + tmp[0] = func; + tmp[1] = data; + + return (DWTID)_beginthread((void (*)(void *))_dwthreadstart, NULL, (z*4096), (void *)tmp); } /*