Closed Bug 214695 Opened 22 years ago Closed 22 years ago

Incorrect use of PR_AtomicDecrement on reference count

Categories

(NSS :: Libraries, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: wtc, Assigned: wtc)

Details

Attachments

(1 file)

I found that at several places we use PR_AtomicDecrement to decrement a reference count but then read the reference count "naked" to determine if it has reached 0. That naked read is not thread safe. Instead, we should simply use the return value of PR_AtomicDecrement, which is the result of the decrement.
Attached patch Proposed patchSplinter Review
Patch checked in on the NSS trunk (3.9).
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Target Milestone: --- → 3.9
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: