You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HI,
Thank your library first.It's very good log library.
I am use for my work.
I use it in a multi thread program.
I found a question that when in function will not exit.
In my main thread ,when i got a signal such as SEGEV then call clean up function. In clean function it will cal zlog_fini(void).
but some time it will hung there and not exit,then the program will not exit.
I use debug message found that 👍 in zlog_fini(void)
rc = pthread_rwlock_wrlock(&zlog_env_lock);
is waiting and not return.because of another thread got the lock somewhere.
if when cleanup i call zlog_fini(void) in that thread it will success and every thing is ok.
So i guess here is a multi thread bug in multi thread call zlog_fini(void).
special thanks for your the good library.
Thanks!
Jeremy Li
The text was updated successfully, but these errors were encountered:
That would happen.
I think when your main thread receive SEGSEV and call zlog_fini in signal handle function,
another working thread is still in log fuction, which get the read lock.
As zlog_fini() should get the write lock, and wait for all the read lock release.
I don't know how to correctly solve this kind of problem in any multi-thread program.
In this case, I think the useful way is not call zlog_fini() in signal handle function.
HI,
Thank your library first.It's very good log library.
I am use for my work.
I use it in a multi thread program.
I found a question that when in function will not exit.
In my main thread ,when i got a signal such as SEGEV then call clean up function. In clean function it will cal zlog_fini(void).
but some time it will hung there and not exit,then the program will not exit.
I use debug message found that 👍 in zlog_fini(void)
rc = pthread_rwlock_wrlock(&zlog_env_lock);
is waiting and not return.because of another thread got the lock somewhere.
if when cleanup i call zlog_fini(void) in that thread it will success and every thing is ok.
So i guess here is a multi thread bug in multi thread call zlog_fini(void).
special thanks for your the good library.
Thanks!
Jeremy Li
The text was updated successfully, but these errors were encountered: