aboutsummaryrefslogtreecommitdiff
path: root/src/threads.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2014-04-24 12:28:28 +0000
committerdrh <drh@noemail.net>2014-04-24 12:28:28 +0000
commit3de4df27dda707357d3fc62bf1c318a7a2e9dfeb (patch)
tree3dbe13908d622289b29f2468711862288994d7b2 /src/threads.c
parent9e0ed8d4ecf02a978f6ec0e8011a3adc5004d0e4 (diff)
downloadsqlite-3de4df27dda707357d3fc62bf1c318a7a2e9dfeb.tar.gz
sqlite-3de4df27dda707357d3fc62bf1c318a7a2e9dfeb.zip
Improvements to comments. Store some extra information in SqliteThread that
is useful for debugging. FossilOrigin-Name: 9fb5e212089d85cdd3b4787dd69c72e6d84560b6
Diffstat (limited to 'src/threads.c')
-rw-r--r--src/threads.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/threads.c b/src/threads.c
index eeab5379c..64975801b 100644
--- a/src/threads.c
+++ b/src/threads.c
@@ -37,9 +37,11 @@
/* A running thread */
struct SQLiteThread {
- pthread_t tid;
- int done;
- void *pOut;
+ pthread_t tid; /* Thread ID */
+ int done; /* Set to true when thread finishes */
+ void *pOut; /* Result returned by the thread */
+ void *(*xTask)(void*); /* The thread routine */
+ void *pIn; /* Argument to the thread */
};
/* Create a new thread */
@@ -56,6 +58,8 @@ int sqlite3ThreadCreate(
p = sqlite3Malloc(sizeof(*p));
if( p==0 ) return SQLITE_NOMEM;
memset(p, 0, sizeof(*p));
+ p->xTask = xTask;
+ p->pIn = pIn;
if( sqlite3GlobalConfig.bCoreMutex==0
|| pthread_create(&p->tid, 0, xTask, pIn)!=0
){