Never use signal handlers to call sqlite3_* functions. Your handler
can be called while another sqlite3_* call is in process but sqlite3_*
functions are not re-entrant, so such code will lead to any kind of
bizarre behavior (including any sort of segmentation fault). Use your
signal handler to set
Thank you
I do the job as you say, but the problem is still here.
There are several processes who write the database. And the place is not
same each time that the problem happens.
How could I know the reason exactly?
PS:
I used the signal to close the connection to database. Just like:
I do the job as you say, but the problem is still here.
There are several processes who write the database. And the place is not
same each time that the problem happens.
How could I know the reason exactly?
PS:
I used the signal to close the connection to database. Just like:
int main ()
{
PS:
I used the signal to close the connection to database. Just like:
int main ()
{
...
signal (SIGUSR2, (void*)sig_handler);
}
void sys_sig_handler(int sig)
{
...
switch(sig)
{
case SIGUSR2:
...
sqlite3_close (db);
...
I do the job as you say, but the problem is still here.
There are several processes who write the database. And the place is not
same each time that the problem happens.
How could I know the reason exactly?
Pavel Ivanov-2 wrote:
>
>> Because there are several process who use the database. I
> Because there are several process who use the database. I have another
> question:Could I close the database of other process in main process?
Just use your favorite IPC mechanism and write your application so
that main process sends message to other process and when other
process receives it
Thank you!
I'm sorry for not showing clearly the environment is embedded linux on arm
board.
Because there are several process who use the database. I have another
question:Could I close the database of other process in main process?
Nick Shaw-3 wrote:
>
> By "other process" do you mean a
By "other process" do you mean a separate DLL or similar? You can't
free memory allocated in a DLL from an application, even when that
application has the DLL loaded - Windows will complain. This could be
what's happening.
Could you instead write the database close call within this other
8 matches
Mail list logo