[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Consult a deadlock problem
- From: Roberto Ierusalimschy <roberto@...>
- Date: Wed, 28 Aug 2019 09:39:37 -0300
> I use lua library in Linux environment, but deadlock phenomenon, the
> following is part of the stack information:
> The problem lies in the use of the following macro:
> #define l_popen(L,c,m) (fflush(NULL), popen(c,m))
> It is fflush(NULL) that causes the deadlock. I can avoid this deadlock
> problem if I don't call fflush before popen.
> So my question is:
> 1. Can I just remove fflush(NULL)? What are the risks?
> 2. If not, is there any other way to solve the problem?
This 'fflush' was introduced in commit 9b47cee8b2. Its comment says:
better to flush all files before starting new process with popen
So, I don't think there is any problem in removing it.