Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Sep 2000 02:16:39 -0700
From:      Alfred Perlstein <bright@wintelcom.net>
To:        Roman Shterenzon <roman@harmonic.co.il>
Cc:        freebsd-stable@FreeBSD.ORG
Subject:   Re: pthreads bug?
Message-ID:  <20000929021639.D27736@fw.wintelcom.net>
In-Reply-To: <970217520.39d4583032fbe@webmail.harmonic.co.il>; from roman@harmonic.co.il on Fri, Sep 29, 2000 at 10:52:00AM %2B0200
References:  <970215688.39d451088fbef@webmail.harmonic.co.il> <20000929013521.C27736@fw.wintelcom.net> <970217520.39d4583032fbe@webmail.harmonic.co.il>

next in thread | previous in thread | raw e-mail | index | archive | help
* Roman Shterenzon <roman@harmonic.co.il> [000929 01:52] wrote:
> Quoting Alfred Perlstein <bright@wintelcom.net>:
> > > I attach example program, which, when receives SIGUSR1 should close
> > the socket,
> > > but, in fact gets blocked in the close() function.
> > > Obviously it's waiting to acquire some lock.
> > > Does anyone have an idea?
> > 
> > Yes, I have an idea and an idea how to fix it, I'm wondering what
> > the thread in accept() sees after this happens?
> > 
> > what is the errno from accept?
> The point is, that when close() is called, accept doesn't break out.
> 
> from close(2)
> IMPLEMENTATION NOTES
>      In the non-threaded library close() is implemented as the close syscall.
> 
>      In the threaded library, the close syscall is assembled to
>      _thread_sys_close() and close() is implemented as a function which locks
>      d for read and write, then calls _thread_sys_close().  Before returning,
>      close() unlocks d.
> 
> 
> So from my point of view the close tries to acquire a lock.

I know that, I should have been more clear, what is in errno on
Linux and Solaris so that I can emulate that?

-- 
-Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org]
"I have the heart of a child; I keep it in a jar on my desk."


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000929021639.D27736>