[SERVER-818] DatabaseHolder mutex issues Created: 23/Mar/10 Updated: 12/Jul/16 Resolved: 23/Mar/10 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 1.4.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Aaron Staple | Assignee: | Eliot Horowitz (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: |
| Description |
|
isLoaded() and get() require a read lock only, but they call operator[] on _paths, which is a write operation. Since c++ maps are not thread-safe, this could cause memory corruption. The read-only members of DatabaseHolder should be made const functions if they can truly be implemented as read-only. (This would make accessing _paths.operator[] a compile error.) |
| Comments |
| Comment by Eliot Horowitz (Inactive) [ 26/Apr/10 ] |
|
in a release |
| Comment by auto [ 23/Mar/10 ] |
|
Author: {'login': 'erh', 'name': 'Eliot Horowitz', 'email': 'eliot@10gen.com'}Message: better thread safety for DatabaseHolder |