mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-05 15:55:57 +03:00
Fix unreachable branches in the threads.c module.
FossilOrigin-Name: 3175e366bbf7579ec9ab27214b0a4e5cd27ea204
This commit is contained in:
@@ -51,6 +51,7 @@ int sqlite3ThreadCreate(
|
||||
void *pIn /* Argument passed into xTask() */
|
||||
){
|
||||
SQLiteThread *p;
|
||||
int rc;
|
||||
|
||||
assert( ppThread!=0 );
|
||||
assert( xTask!=0 );
|
||||
@@ -63,7 +64,12 @@ int sqlite3ThreadCreate(
|
||||
memset(p, 0, sizeof(*p));
|
||||
p->xTask = xTask;
|
||||
p->pIn = pIn;
|
||||
if( sqlite3FaultSim(200) ? 1 : pthread_create(&p->tid, 0, xTask, pIn) ){
|
||||
if( sqlite3FaultSim(200) ){
|
||||
rc = 1;
|
||||
}else{
|
||||
rc = pthread_create(&p->tid, 0, xTask, pIn);
|
||||
}
|
||||
if( rc ){
|
||||
p->done = 1;
|
||||
p->pOut = xTask(pIn);
|
||||
}
|
||||
@@ -76,7 +82,7 @@ int sqlite3ThreadJoin(SQLiteThread *p, void **ppOut){
|
||||
int rc;
|
||||
|
||||
assert( ppOut!=0 );
|
||||
if( p==0 ) return SQLITE_NOMEM;
|
||||
if( NEVER(p==0) ) return SQLITE_NOMEM;
|
||||
if( p->done ){
|
||||
*ppOut = p->pOut;
|
||||
rc = SQLITE_OK;
|
||||
@@ -160,7 +166,7 @@ int sqlite3ThreadJoin(SQLiteThread *p, void **ppOut){
|
||||
BOOL bRc;
|
||||
|
||||
assert( ppOut!=0 );
|
||||
if( p==0 ) return SQLITE_NOMEM;
|
||||
if( NEVER(p==0) ) return SQLITE_NOMEM;
|
||||
if( p->xTask==0 ){
|
||||
rc = WAIT_OBJECT_0;
|
||||
}else{
|
||||
@@ -222,7 +228,7 @@ int sqlite3ThreadCreate(
|
||||
int sqlite3ThreadJoin(SQLiteThread *p, void **ppOut){
|
||||
|
||||
assert( ppOut!=0 );
|
||||
if( p==0 ) return SQLITE_NOMEM;
|
||||
if( NEVER(p==0) ) return SQLITE_NOMEM;
|
||||
if( p->xTask ){
|
||||
*ppOut = p->xTask(p->pIn);
|
||||
}else{
|
||||
|
Reference in New Issue
Block a user