Open achieverForever opened 2 years ago
Make sure access to the shared UnQLite handle is serialized. This is easily done via these API calls before opening any database (when your program starts):
unqlite_lib_config(UNQLITE_LIB_CONFIG_THREAD_LEVEL_MULTI);
unqlite_lib_init();
if (!unqlite_lib_is_threadsafe()) {
std::cerr << "UnQLite must be compiled with threading support. Aborting!" << std::endl;
return 1;
}
I encountered a NPE in
unqliteOsWrite
in Android multithreaded environment. I think it's a multithreaded issue, howeverUNQLITE_ENABLE_THREADS
compiler flag has been enabled andunqlite_lib_is_threadsafe
returns true.Exception code:
And desymbolized:
It seems like there is a NPE in the following code?
Thanks for your help!