[SERVER-27897] Remove uses of temporary RAII objects Created: 02/Feb/17 Updated: 05/Apr/17 Resolved: 16/Feb/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Concurrency |
| Affects Version/s: | None |
| Fix Version/s: | 3.5.4 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Geert Bosch | Assignee: | Geert Bosch |
| Resolution: | Done | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||
| Sprint: | Storage 2017-03-06 | ||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Description |
|
A common RAII idiom for locking is as follows:
However, as the name of the object (lk) isn't referenced, this is very easily mistyped as:
So, check for any occurrences of temporaries with constructors and instead use named variables. |
| Comments |
| Comment by Githook User [ 16/Feb/17 ] |
|
Author: {u'username': u'GeertBosch', u'name': u'Geert Bosch', u'email': u'geert@mongodb.com'}Message: |