Fossil SCM

Rename new setting to 'max-wthreads'. Make sure all new code relies upon USE_SYSTEM_SQLITE. Style cleanup.

mistachkin 2014-09-12 21:43 pending-review
Commit c40085c55801ab44136e4e783ac3e217cd7739f7
3 files changed +11 -6 +5 -1 +3 -1
+11 -6
--- src/db.c
+++ src/db.c
@@ -741,11 +741,13 @@
741741
sqlite3_create_function(
742742
db, "if_selected", 3, SQLITE_UTF8, 0, file_is_selected,0,0
743743
);
744744
if( g.fSqlTrace ) sqlite3_trace(db, db_sql_trace, 0);
745745
re_add_sql_func(db);
746
- sqlite3_limit(db, SQLITE_LIMIT_WORKER_THREADS, g.iMaxWorkerThreads);
746
+#if USE_SYSTEM_SQLITE+0==1
747
+ sqlite3_limit(db, SQLITE_LIMIT_WORKER_THREADS, g.maxWorkerThreads);
748
+#endif
747749
sqlite3_exec(db, "PRAGMA foreign_keys=OFF;", 0, 0, 0);
748750
return db;
749751
}
750752
751753
@@ -1051,11 +1053,13 @@
10511053
g.zRepositoryName = mprintf("%s", zDbName);
10521054
db_open_or_attach(g.zRepositoryName, "repository", 0);
10531055
g.repositoryOpen = 1;
10541056
/* Cache "allow-symlinks" option, because we'll need it on every stat call */
10551057
g.allowSymlinks = db_get_boolean("allow-symlinks", 0);
1056
- g.iMaxWorkerThreads = db_get_int("max-worker-threads", 0);
1058
+#if USE_SYSTEM_SQLITE+0==1
1059
+ g.maxWorkerThreads = db_get_int("max-wthreads", 0);
1060
+#endif
10571061
}
10581062
10591063
/*
10601064
** Flags for the db_find_and_open_repository() function.
10611065
*/
@@ -2191,11 +2195,11 @@
21912195
{ "main-branch", 0, 40, 0, 0, "trunk" },
21922196
{ "manifest", 0, 0, 1, 0, "off" },
21932197
{ "max-loadavg", 0, 25, 0, 0, "0.0" },
21942198
{ "max-upload", 0, 25, 0, 0, "250000" },
21952199
#if USE_SYSTEM_SQLITE+0==1
2196
- { "max-worker-threads", 0, 16, 0, 0, "0" },
2200
+ { "max-wthreads", 0, 16, 0, 0, "0" },
21972201
#endif
21982202
{ "mtime-changes", 0, 0, 0, 0, "on" },
21992203
{ "pgp-command", 0, 40, 0, 0, "gpg --clearsign -o " },
22002204
{ "proxy", 0, 32, 0, 0, "off" },
22012205
{ "relative-paths", 0, 0, 0, 0, "on" },
@@ -2363,13 +2367,14 @@
23632367
** global configuration database.
23642368
**
23652369
** max-upload A limit on the size of uplink HTTP requests. The
23662370
** default is 250000 bytes.
23672371
**
2368
-** max-worker-threads The maximum number of auxiliary worker threads that a
2369
-** single prepared statement may start. Only works when
2370
-** SQLite is compiled with multi-thread support.
2372
+** max-wthreads The maximum number of auxiliary worker threads that a
2373
+** single prepared statement may start. Only works when
2374
+** using the system SQLite library and when that library
2375
+** was compiled with support for threading.
23712376
**
23722377
** mtime-changes Use file modification times (mtimes) to detect when
23732378
** files have been modified. (Default "on".)
23742379
**
23752380
** pgp-command Command used to clear-sign manifests at check-in.
23762381
--- src/db.c
+++ src/db.c
@@ -741,11 +741,13 @@
741 sqlite3_create_function(
742 db, "if_selected", 3, SQLITE_UTF8, 0, file_is_selected,0,0
743 );
744 if( g.fSqlTrace ) sqlite3_trace(db, db_sql_trace, 0);
745 re_add_sql_func(db);
746 sqlite3_limit(db, SQLITE_LIMIT_WORKER_THREADS, g.iMaxWorkerThreads);
 
 
747 sqlite3_exec(db, "PRAGMA foreign_keys=OFF;", 0, 0, 0);
748 return db;
749 }
750
751
@@ -1051,11 +1053,13 @@
1051 g.zRepositoryName = mprintf("%s", zDbName);
1052 db_open_or_attach(g.zRepositoryName, "repository", 0);
1053 g.repositoryOpen = 1;
1054 /* Cache "allow-symlinks" option, because we'll need it on every stat call */
1055 g.allowSymlinks = db_get_boolean("allow-symlinks", 0);
1056 g.iMaxWorkerThreads = db_get_int("max-worker-threads", 0);
 
 
1057 }
1058
1059 /*
1060 ** Flags for the db_find_and_open_repository() function.
1061 */
@@ -2191,11 +2195,11 @@
2191 { "main-branch", 0, 40, 0, 0, "trunk" },
2192 { "manifest", 0, 0, 1, 0, "off" },
2193 { "max-loadavg", 0, 25, 0, 0, "0.0" },
2194 { "max-upload", 0, 25, 0, 0, "250000" },
2195 #if USE_SYSTEM_SQLITE+0==1
2196 { "max-worker-threads", 0, 16, 0, 0, "0" },
2197 #endif
2198 { "mtime-changes", 0, 0, 0, 0, "on" },
2199 { "pgp-command", 0, 40, 0, 0, "gpg --clearsign -o " },
2200 { "proxy", 0, 32, 0, 0, "off" },
2201 { "relative-paths", 0, 0, 0, 0, "on" },
@@ -2363,13 +2367,14 @@
2363 ** global configuration database.
2364 **
2365 ** max-upload A limit on the size of uplink HTTP requests. The
2366 ** default is 250000 bytes.
2367 **
2368 ** max-worker-threads The maximum number of auxiliary worker threads that a
2369 ** single prepared statement may start. Only works when
2370 ** SQLite is compiled with multi-thread support.
 
2371 **
2372 ** mtime-changes Use file modification times (mtimes) to detect when
2373 ** files have been modified. (Default "on".)
2374 **
2375 ** pgp-command Command used to clear-sign manifests at check-in.
2376
--- src/db.c
+++ src/db.c
@@ -741,11 +741,13 @@
741 sqlite3_create_function(
742 db, "if_selected", 3, SQLITE_UTF8, 0, file_is_selected,0,0
743 );
744 if( g.fSqlTrace ) sqlite3_trace(db, db_sql_trace, 0);
745 re_add_sql_func(db);
746 #if USE_SYSTEM_SQLITE+0==1
747 sqlite3_limit(db, SQLITE_LIMIT_WORKER_THREADS, g.maxWorkerThreads);
748 #endif
749 sqlite3_exec(db, "PRAGMA foreign_keys=OFF;", 0, 0, 0);
750 return db;
751 }
752
753
@@ -1051,11 +1053,13 @@
1053 g.zRepositoryName = mprintf("%s", zDbName);
1054 db_open_or_attach(g.zRepositoryName, "repository", 0);
1055 g.repositoryOpen = 1;
1056 /* Cache "allow-symlinks" option, because we'll need it on every stat call */
1057 g.allowSymlinks = db_get_boolean("allow-symlinks", 0);
1058 #if USE_SYSTEM_SQLITE+0==1
1059 g.maxWorkerThreads = db_get_int("max-wthreads", 0);
1060 #endif
1061 }
1062
1063 /*
1064 ** Flags for the db_find_and_open_repository() function.
1065 */
@@ -2191,11 +2195,11 @@
2195 { "main-branch", 0, 40, 0, 0, "trunk" },
2196 { "manifest", 0, 0, 1, 0, "off" },
2197 { "max-loadavg", 0, 25, 0, 0, "0.0" },
2198 { "max-upload", 0, 25, 0, 0, "250000" },
2199 #if USE_SYSTEM_SQLITE+0==1
2200 { "max-wthreads", 0, 16, 0, 0, "0" },
2201 #endif
2202 { "mtime-changes", 0, 0, 0, 0, "on" },
2203 { "pgp-command", 0, 40, 0, 0, "gpg --clearsign -o " },
2204 { "proxy", 0, 32, 0, 0, "off" },
2205 { "relative-paths", 0, 0, 0, 0, "on" },
@@ -2363,13 +2367,14 @@
2367 ** global configuration database.
2368 **
2369 ** max-upload A limit on the size of uplink HTTP requests. The
2370 ** default is 250000 bytes.
2371 **
2372 ** max-wthreads The maximum number of auxiliary worker threads that a
2373 ** single prepared statement may start. Only works when
2374 ** using the system SQLite library and when that library
2375 ** was compiled with support for threading.
2376 **
2377 ** mtime-changes Use file modification times (mtimes) to detect when
2378 ** files have been modified. (Default "on".)
2379 **
2380 ** pgp-command Command used to clear-sign manifests at check-in.
2381
+5 -1
--- src/main.c
+++ src/main.c
@@ -221,11 +221,15 @@
221221
int anAuxCols[MX_AUX]; /* Number of columns for option() values */
222222
223223
int allowSymlinks; /* Cached "allow-symlinks" option */
224224
225225
int mainTimerId; /* Set to fossil_timer_start() */
226
- int iMaxWorkerThreads ; /* Store "max-worker-threads" setting */
226
+
227
+#if USE_SYSTEM_SQLITE+0==1
228
+ int maxWorkerThreads; /* Cached "max-wthreads" option */
229
+#endif
230
+
227231
#ifdef FOSSIL_ENABLE_JSON
228232
struct FossilJsonBits {
229233
int isJsonMode; /* True if running in JSON mode, else
230234
false. This changes how errors are
231235
reported. In JSON mode we try to
232236
--- src/main.c
+++ src/main.c
@@ -221,11 +221,15 @@
221 int anAuxCols[MX_AUX]; /* Number of columns for option() values */
222
223 int allowSymlinks; /* Cached "allow-symlinks" option */
224
225 int mainTimerId; /* Set to fossil_timer_start() */
226 int iMaxWorkerThreads ; /* Store "max-worker-threads" setting */
 
 
 
 
227 #ifdef FOSSIL_ENABLE_JSON
228 struct FossilJsonBits {
229 int isJsonMode; /* True if running in JSON mode, else
230 false. This changes how errors are
231 reported. In JSON mode we try to
232
--- src/main.c
+++ src/main.c
@@ -221,11 +221,15 @@
221 int anAuxCols[MX_AUX]; /* Number of columns for option() values */
222
223 int allowSymlinks; /* Cached "allow-symlinks" option */
224
225 int mainTimerId; /* Set to fossil_timer_start() */
226
227 #if USE_SYSTEM_SQLITE+0==1
228 int maxWorkerThreads; /* Cached "max-wthreads" option */
229 #endif
230
231 #ifdef FOSSIL_ENABLE_JSON
232 struct FossilJsonBits {
233 int isJsonMode; /* True if running in JSON mode, else
234 false. This changes how errors are
235 reported. In JSON mode we try to
236
+3 -1
--- src/sqlcmd.c
+++ src/sqlcmd.c
@@ -124,11 +124,13 @@
124124
sqlite3_create_function(db, "compress", 1, SQLITE_UTF8, 0,
125125
sqlcmd_compress, 0, 0);
126126
sqlite3_create_function(db, "decompress", 1, SQLITE_UTF8, 0,
127127
sqlcmd_decompress, 0, 0);
128128
re_add_sql_func(db);
129
- sqlite3_limit(db, SQLITE_LIMIT_WORKER_THREADS, g.iMaxWorkerThreads);
129
+#if USE_SYSTEM_SQLITE+0==1
130
+ sqlite3_limit(db, SQLITE_LIMIT_WORKER_THREADS, g.maxWorkerThreads);
131
+#endif
130132
g.repositoryOpen = 1;
131133
g.db = db;
132134
return SQLITE_OK;
133135
}
134136
135137
--- src/sqlcmd.c
+++ src/sqlcmd.c
@@ -124,11 +124,13 @@
124 sqlite3_create_function(db, "compress", 1, SQLITE_UTF8, 0,
125 sqlcmd_compress, 0, 0);
126 sqlite3_create_function(db, "decompress", 1, SQLITE_UTF8, 0,
127 sqlcmd_decompress, 0, 0);
128 re_add_sql_func(db);
129 sqlite3_limit(db, SQLITE_LIMIT_WORKER_THREADS, g.iMaxWorkerThreads);
 
 
130 g.repositoryOpen = 1;
131 g.db = db;
132 return SQLITE_OK;
133 }
134
135
--- src/sqlcmd.c
+++ src/sqlcmd.c
@@ -124,11 +124,13 @@
124 sqlite3_create_function(db, "compress", 1, SQLITE_UTF8, 0,
125 sqlcmd_compress, 0, 0);
126 sqlite3_create_function(db, "decompress", 1, SQLITE_UTF8, 0,
127 sqlcmd_decompress, 0, 0);
128 re_add_sql_func(db);
129 #if USE_SYSTEM_SQLITE+0==1
130 sqlite3_limit(db, SQLITE_LIMIT_WORKER_THREADS, g.maxWorkerThreads);
131 #endif
132 g.repositoryOpen = 1;
133 g.db = db;
134 return SQLITE_OK;
135 }
136
137

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button