mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-28 06:12:53 -06:00
Core: Win32 Thread now reserves smaller stack, AuxThread even smaller than than (1MB, 512KB)
git-svn-id: svn://ultimatepp.org/upp/trunk@10391 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
de1c8b559e
commit
127d7f4b00
1 changed files with 2 additions and 2 deletions
|
|
@ -146,7 +146,7 @@ bool Thread::Run(Function<void ()> _cb, bool noshutdown)
|
|||
p->noshutdown = noshutdown;
|
||||
#ifdef PLATFORM_WIN32
|
||||
#ifdef CPU_32 // in 32-bit, reduce stack size to 1MB to fit more threads into address space
|
||||
handle = (HANDLE)_beginthreadex(0, 1024*1024, sThreadRoutine, p, 0, ((unsigned int *)(&thread_id)));
|
||||
handle = (HANDLE)_beginthreadex(0, 1024*1024, sThreadRoutine, p, STACK_SIZE_PARAM_IS_A_RESERVATION, ((unsigned int *)(&thread_id)));
|
||||
#else
|
||||
handle = (HANDLE)_beginthreadex(0, 0, sThreadRoutine, p, 0, ((unsigned int *)(&thread_id)));
|
||||
#endif
|
||||
|
|
@ -633,7 +633,7 @@ bool StartAuxThread(auxthread_t (auxthread__ *fn)(void *ptr), void *ptr)
|
|||
{
|
||||
#ifdef PLATFORM_WIN32
|
||||
HANDLE handle;
|
||||
handle = CreateThread(NULL, 0, fn, ptr, 0, NULL);
|
||||
handle = CreateThread(NULL, 512*1024, fn, ptr, STACK_SIZE_PARAM_IS_A_RESERVATION, NULL);
|
||||
if(handle) {
|
||||
CloseHandle(handle);
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue