diff options
author | drh <drh@noemail.net> | 2009-07-03 12:57:58 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2009-07-03 12:57:58 +0000 |
commit | 06150f95e8475fd98db35d7c825d7459b596bf37 (patch) | |
tree | 2478ac291f0936470ec1e22070858b791ff7ad22 /src/os_unix.c | |
parent | 34acdc9573162672ab03b0d02882a992b80333d3 (diff) | |
download | sqlite-06150f95e8475fd98db35d7c825d7459b596bf37.tar.gz sqlite-06150f95e8475fd98db35d7c825d7459b596bf37.zip |
Test the result of pthread_create() and do not call pthread_join() if the
thread creation failed. Ticket #3933. (CVS 6839)
FossilOrigin-Name: 304c5110ad958b2cc1ddff30e68c8791109128b5
Diffstat (limited to 'src/os_unix.c')
-rw-r--r-- | src/os_unix.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index b917a1a40..bc0f32cde 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -43,7 +43,7 @@ ** * Definitions of sqlite3_vfs objects for all locking methods ** plus implementations of sqlite3_os_init() and sqlite3_os_end(). ** -** $Id: os_unix.c,v 1.253 2009/06/17 13:09:39 drh Exp $ +** $Id: os_unix.c,v 1.254 2009/07/03 12:57:58 drh Exp $ */ #include "sqliteInt.h" #if SQLITE_OS_UNIX /* This file is used on unix only */ @@ -839,13 +839,14 @@ static void testThreadLockingBehavior(int fd_orig){ d.fd = fd; d.lock = l; d.lock.l_type = F_WRLCK; - pthread_create(&t, 0, threadLockingTest, &d); - pthread_join(t, 0); + if( pthread_create(&t, 0, threadLockingTest, &d)==0 ){ + pthread_join(t, 0); + } close(fd); if( d.result!=0 ) return; threadsOverrideEachOthersLocks = (d.lock.l_type==F_UNLCK); } -#endif /* SQLITE_THERADSAFE && defined(__linux__) */ +#endif /* SQLITE_THREADSAFE && defined(__linux__) */ /* ** Release a unixLockInfo structure previously allocated by findLockInfo(). |