1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Improvements to comments. Store some extra information in SqliteThread that

is useful for debugging.

FossilOrigin-Name: 9fb5e212089d85cdd3b4787dd69c72e6d84560b6
This commit is contained in:
drh
2014-04-24 12:28:28 +00:00
parent 9e0ed8d4ec
commit 3de4df27dd
4 changed files with 25 additions and 18 deletions

View File

@@ -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
){