[PATCH] Don't close or flush stdio streams on abort
Rich Felker
dalias@aerifal.cx
Thu May 9 22:24:00 GMT 2013
On Thu, May 09, 2013 at 09:54:08PM +0200, OndÅej BÃlka wrote:
> On Thu, May 09, 2013 at 09:53:13AM -0400, Rich Felker wrote:
> > On Thu, May 09, 2013 at 09:51:04AM +0200, OndÅej BÃlka wrote:
> > > On Wed, May 08, 2013 at 06:22:50PM -0400, Rich Felker wrote:
> > > > On Wed, May 08, 2013 at 11:51:26PM +0200, OndÅej BÃlka wrote:
> > > > > > With the right types of locks, a trylock operation could be performed
> > > > > > instead of waiting for a lock. This requires an async-signal-safe,
> > > > > > reentrant, recursive mutex.
> > > > >
> > > > > It is most elegant solution but not only way. My comment
> > > > > was that when you stop other threads and block signals then writing if
> > > > > they are unlocked can be done with any type of lock. You also do not
> > > > > worry to unlock correctly as program ends. (Overkill but possible..)
> > > >
> > > > You mean you want to stop all other threads, then forcibly steal their
> > > > locks? This is not valid. The state protected by the lock need not be
> > >
> > > No. I want to stop threads to stop them trying to take locks. When lock
> > > is held do nothing.
> >
> > The easiest way to do this is by taking the lock...
> >
> Which can lead deadlock, which this patch tries to avoid.
See above; the proposal was that it could be done with a trylock. Then
there is no possibility of deadlock because the thread calling abort
never waits for a lock before the process terminates.
Rich
More information about the Libc-alpha
mailing list