[GODRIVER-75] Use defer for mutex unlocking Created: 06/Sep/17 Updated: 28/Oct/23 Resolved: 25/Oct/17 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 0.0.1 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | David Golden | Assignee: | Samuel Rossi (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
Much of the monitoring code I've looked at relies on manual mutex unlocking. This is not generally idiomatic Go (except in hot code paths) and leads to errors, as shown in We should change all unlocking to use defer when possible. (N.B. For whoever does this work: note that it's not possible inside a for loop, as defer is function scoped, not loop scoped.) |
| Comments |
| Comment by Githook User [ 10/Nov/17 ] |
|
Author: {'name': 'Saghm Rossi', 'username': 'saghm', 'email': 'saghmrossi@gmail.com'}Message: |
| Comment by Samuel Rossi (Inactive) [ 25/Oct/17 ] |
|
Git commit: https://github.com/10gen/mongo-go-driver/commit/f06f1a772cf5f212bdf0f3bef46bf8bea0deeb4d |