About ne_set_read_timeout

Patrick Ohly patrick.ohly at gmx.de
Tue Feb 5 02:49:09 EST 2013

On Tue, 2013-02-05 at 08:34 +0100, Patrick Ohly wrote:
> On Mon, 2013-02-04 at 23:04 +0100, Henrik Holst wrote:
> > I agree that there's a place for an official way of aborting a
> > session, but I fail to grasp your example.
> > 
> > #1 neon isn't thread safe so the two threads shouldn't be sharing the
> > same session to begin with, and if they did then they would have to
> > protect it with a mutex anyways.
> Later in the mail thread you said "I told you to call ne_close_session()
> from another thread".
> The root problem is that in a single-threaded program, once control is
> handed over to neon in long-running calls like ne_propfind_* or
> ne_request_dispatch, there's no chance to abort based on some kind of
> event like incoming data in another IO stream. Signals work, but that's
> not always an option.

I should add that protecting the usage of the single neon session with a
mutex before calling ne_propfind_*/ne_request_dispatch doesn't work
either, because to abort the calls, the other thread would have to
acquire that mutex while the calls still run. It'll not be able to
obtain that mutex until after the calls, which defeats the whole

Bye, Patrick Ohly
Patrick.Ohly at gmx.de

More information about the neon mailing list