apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Ruppert ...@ruppert-it.de>
Subject Re: apr_file_close()/apr_socket_close()
Date Fri, 30 Oct 2009 14:12:05 GMT
Bojan Smojver wrote:
> Now, the first thread, the one using APR file, in the signal handler
> that interrupted it, calls apr_file_os_get() on that file. It gets back
> the FD from the second thread! That is a problem that no locking of APR
> file can solve. Any action on this FD will do things to the file from
> the second thread, not from this one (because it's already closed).
> But, by setting file->filedes to -1 before the close(), we can at least
> mitigate the consequences of such a situation.

Ok, I got your point. It is not a threading issue. Its a signal handler 
issue. For that purpose your proposal works just fine.


View raw message