SQLite Forum

warning: function may return address of local variable [-Wreturn-local-addr]

SQLite3 is multiple-entrant (can be executed on multiple threads simultaneously) but is only singly-entrant per connection.

In other words, the sqlite3SelectNew() function will only be executed on one thread per connection, however, multiple connections may execute the function concurrently.  The mutex protects simultaneous access to the connection and is not a single execution path (a critical section).