Use recursive mutexes in pthreads.  If the pthreads implementation does not
support recursive mutexes, then you cannot compile SQLite with
SQLITE_THREADSAFE=1.  Ticket #2588. (CVS 4297)

FossilOrigin-Name: 1668284d151e78d16b0d83bf55dfd9d349a452a7
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index 1719199..7e0c59f 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -11,12 +11,13 @@
 *************************************************************************
 ** Internal interface definitions for SQLite.
 **
-** @(#) $Id: sqliteInt.h,v 1.599 2007/08/24 08:15:54 danielk1977 Exp $
+** @(#) $Id: sqliteInt.h,v 1.600 2007/08/25 14:39:46 drh Exp $
 */
 #ifndef _SQLITEINT_H_
 #define _SQLITEINT_H_
 #include "sqliteLimit.h"
 
+#define _XOPEN_SOURCE 500  /* Needed to enable pthread recursive mutexes */
 
 #if defined(SQLITE_TCL) || defined(TCLSH)
 # include <tcl.h>