On Sun, Nov 25, 2012 at 4:12 AM, Martin Velek <martin.ve...@gmail.com>wrote:

> Hello,
>
> I am trying to port the Sqlite to a FreeRTOS and I am little bit
> confused about mutex implementation, especially order of calling init
> functions.
> On the Custom Builds documentation page
> http://www.sqlite.org/custombuild.html is stated:
>
>  "The auxiliary C code file can contain an implementation of
> sqlite3_initialize() that registers an appropriate VFS and also
> perhaps initializes an alternative mutex system (if mutexes are
> required) or does any memory allocation subsystem initialization that
> is required. ..."
>
> but the Mutex documentationpage
> http://www.sqlite.org/c3ref/mutex_alloc.html tells:
>  " a custom mutex implementation using the SQLITE_CONFIG_MUTEX option
> of the sqlite3_config() function before calling sqlite3_initialize()
> or any other public sqlite3_ function that calls
> sqlite3_initialize()..."
>
> If I undestand correctly I need to call sqlite3_config() before
> sqlite3_initialize(). Thus the mutex system cannot be registered
> inside sqlite3_initialize() as stated on the  Custom Builds
> documentation page.
>

The sqlite3_config(SQLITE_CONFIG_MUTEX,...) call tells SQLite what the
mutex functions are, but does not activate the mutex module.  The mutex
module is activated by sqlite3_initialize().  Perhaps we should change the
documentation to say "activate" instead of "initialize"....


>
> Thank you for explanation
>
> Best
> Martin Velek
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to