Open Bug 326255 Opened 19 years ago Updated 2 years ago

PRWRLock calls are not reentrant (win32 native threads)

Categories

(NSPR :: NSPR, defect)

x86
Windows 2000
defect

Tracking

(Not tracked)

People

(Reporter: cosmin, Unassigned)

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050920 Firefox/1.0.7
Build Identifier: nspr/4.3

Consecutive calls to PR_RWLock_Rlock or PR_RWLock_Wlock from the same thread are treated as if comin fromdifferent threads, this means that 
PR_RWLock_Rlock(lock);PR_RWLock_Rlock(lock);
Will acquire 2 read locks, any other combination will block the execution.
I don't know if the interface is meant to be reentrant, as the contract is not documented or if there is any other way to handle this...

Reproducible: Always

Steps to Reproduce:
PRRWLock *lock = PR_NewRWLock(PR_RWLOCK_RANK_NONE, "my test");
PR_RWLock_Rlock(lock);
PR_RWLock_Wlock(lock);

Actual Results:  
execution is blocked

Expected Results:  
caller acquires an write lock, execution continues
The interface is not meant to be reentrant.  I guess
we need to stress this point in the documentation.
Status: UNCONFIRMED → NEW
Ever confirmed: true
QA Contact: wtchang → nspr

The bug assignee didn't login in Bugzilla in the last 7 months, so the assignee is being reset.

Assignee: wtc → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.