Przeglądaj źródła

Fix thread init bug introduced

z3APA3A 10 lat temu
rodzic
commit
ad9b0046d9
2 zmienionych plików z 6 dodań i 4 usunięć
  1. 1 1
      src/common.c
  2. 5 3
      src/proxymain.c

+ 1 - 1
src/common.c

@@ -61,7 +61,7 @@ struct extparam conf = {
 #ifdef __FreeBSD__
 #ifdef __FreeBSD__
 	16384, 
 	16384, 
 #else
 #else
-	0
+	0,
 #endif
 #endif
 	0, -1, 0, 0, 0, 0, 0, 500, 0, 0, 0,
 	0, -1, 0, 0, 0, 0, 0, 500, 0, 0, 0,
 	6, 600,
 	6, 600,

+ 5 - 3
src/proxymain.c

@@ -401,9 +401,6 @@ int MODULEMAINFUNC (int argc, char** argv){
 	return((*srv.pf)((void *)newparam)? 1:0);
 	return((*srv.pf)((void *)newparam)? 1:0);
 	
 	
  }
  }
- pthread_attr_init(&pa);
- pthread_attr_setstacksize(&pa,PTHREAD_STACK_MIN + (8192 + srv.stacksize));
- pthread_attr_setdetachstate(&pa,PTHREAD_CREATE_DETACHED);
 #endif
 #endif
 
 
 
 
@@ -509,6 +506,11 @@ int MODULEMAINFUNC (int argc, char** argv){
  srv.fds.fd = sock;
  srv.fds.fd = sock;
  srv.fds.events = POLLIN;
  srv.fds.events = POLLIN;
  
  
+#ifndef _WIN32
+ pthread_attr_init(&pa);
+ pthread_attr_setstacksize(&pa,PTHREAD_STACK_MIN + (8192 + srv.stacksize));
+ pthread_attr_setdetachstate(&pa,PTHREAD_CREATE_DETACHED);
+#endif
 
 
  for (;;) {
  for (;;) {
 	for(;;){
 	for(;;){