Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Unified Diff: third_party/sqlite/src/src/test_server.c

Issue 949043002: Add //third_party/sqlite to dirs_to_snapshot, remove net_sql.patch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/sqlite/src/src/test_schema.c ('k') | third_party/sqlite/src/src/test_sqllog.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/src/test_server.c
diff --git a/third_party/sqlite/src/src/test_server.c b/third_party/sqlite/src/src/test_server.c
index ed0818e6f65f27282dc7b1c190ec188c8933002b..4eb1cf19660e9bddd5f7cfd6228f78b54c3c9276 100644
--- a/third_party/sqlite/src/src/test_server.c
+++ b/third_party/sqlite/src/src/test_server.c
@@ -473,6 +473,32 @@ void sqlite3_server_start(void){
}
/*
+** A wrapper around sqlite3_server() that decrements the int variable
+** pointed to by the first argument after the sqlite3_server() call
+** returns.
+*/
+static void *serverWrapper(void *pnDecr){
+ void *p = sqlite3_server(0);
+ (*(int*)pnDecr)--;
+ return p;
+}
+
+/*
+** This function is the similar to sqlite3_server_start(), except that
+** the integer pointed to by the first argument is decremented when
+** the server thread exits.
+*/
+void sqlite3_server_start2(int *pnDecr){
+ pthread_t x;
+ int rc;
+ g.serverHalt = 0;
+ rc = pthread_create(&x, 0, serverWrapper, (void*)pnDecr);
+ if( rc==0 ){
+ pthread_detach(x);
+ }
+}
+
+/*
** If a server thread is running, then stop it. If no server is
** running, this routine is effectively a no-op.
**
« no previous file with comments | « third_party/sqlite/src/src/test_schema.c ('k') | third_party/sqlite/src/src/test_sqllog.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698