← Back to team overview

maria-developers team mailing list archive

bzr commit into MariaDB 5.1, with Maria 1.5:maria branch (knielsen:2779)

 

#At lp:maria

 2779 knielsen@xxxxxxxxxxxxxxx	2009-12-22
      Slightly better way to handle max_connections for embedded server.
      modified:
        storage/pbxt/src/ha_pbxt.cc

=== modified file 'storage/pbxt/src/ha_pbxt.cc'
--- a/storage/pbxt/src/ha_pbxt.cc	2009-12-22 10:33:20 +0000
+++ b/storage/pbxt/src/ha_pbxt.cc	2009-12-22 11:52:44 +0000
@@ -1175,12 +1175,13 @@ static int pbxt_init(void *p)
 		 * +1 Temporary thread (e.g. TempForClose, TempForEnd)
 		 */
 #ifndef DRIZZLED
-#ifdef EMBEDDED_LIBRARY
-                pbxt_max_threads = 100;
-#else
-		if (pbxt_max_threads == 0)
-			pbxt_max_threads = max_connections + 7;
-#endif
+		if (pbxt_max_threads == 0) {
+			// Embedded server sets max_connections=1
+			if (max_connections > 1)
+				pbxt_max_threads = max_connections + 7;
+			else
+				pbxt_max_threads = 100;
+		}
 #endif
 		self = xt_init_threading(pbxt_max_threads);				/* Create the main self: */
 		if (!self)