mirror of
https://github.com/3proxy/3proxy.git
synced 2025-02-24 02:55:40 +08:00
Reduce stack usage for threads
Reduce stack usage, because large logging buffers are removed from stack.
This commit is contained in:
parent
7df2461a26
commit
9876172e0b
@ -173,7 +173,7 @@ int MODULEMAINFUNC (int argc, char** argv){
|
|||||||
signal(SIGPIPE, SIG_IGN);
|
signal(SIGPIPE, SIG_IGN);
|
||||||
|
|
||||||
pthread_attr_init(&pa);
|
pthread_attr_init(&pa);
|
||||||
pthread_attr_setstacksize(&pa,PTHREAD_STACK_MIN + 16384);
|
pthread_attr_setstacksize(&pa,PTHREAD_STACK_MIN + 8192);
|
||||||
pthread_attr_setdetachstate(&pa,PTHREAD_CREATE_DETACHED);
|
pthread_attr_setdetachstate(&pa,PTHREAD_CREATE_DETACHED);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@ -601,7 +601,7 @@ int MODULEMAINFUNC (int argc, char** argv){
|
|||||||
#ifndef _WINCE
|
#ifndef _WINCE
|
||||||
h = (HANDLE)_beginthreadex((LPSECURITY_ATTRIBUTES )NULL, (unsigned)16384, threadfunc, (void *) newparam, 0, &thread);
|
h = (HANDLE)_beginthreadex((LPSECURITY_ATTRIBUTES )NULL, (unsigned)16384, threadfunc, (void *) newparam, 0, &thread);
|
||||||
#else
|
#else
|
||||||
h = (HANDLE)CreateThread((LPSECURITY_ATTRIBUTES )NULL, (unsigned)32768, threadfunc, (void *) newparam, 0, &thread);
|
h = (HANDLE)CreateThread((LPSECURITY_ATTRIBUTES )NULL, (unsigned)16384, threadfunc, (void *) newparam, 0, &thread);
|
||||||
#endif
|
#endif
|
||||||
srv.childcount++;
|
srv.childcount++;
|
||||||
if (h) {
|
if (h) {
|
||||||
|
Loading…
Reference in New Issue
Block a user