apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <...@manyfish.co.uk>
Subject Re: recursive apr_thread_rwlock_wrlock?
Date Mon, 29 Mar 2004 06:16:07 GMT
On Sun, Mar 28, 2004 at 04:57:53PM -0500, Marc M. Adkins wrote:
> Is it possible that apr_thread_rwlock_wrlock will allow recursive behavior on 
> Windows but not on Linux?  By this I mean that a specific thread will request 
> a write lock and then request the same write lock again, intending to release 
> it twice on the way out:

Yes, that gives undefined behaviour in a POSIX implementation,
apr_thread_rwlock.h on HEAD says:

/**
 * Note: The following operations have undefined results: unlocking a
 * read-write lock which is not locked in the calling thread; write
 * locking a read-write lock which is already locked by the calling
 * thread; destroying a read-write lock more than once; clearing or
 * destroying the pool from which a <b>locked</b> read-write lock is
 * allocated.
 */

Regards,

joe

Mime
View raw message