[SERVER-35683] Make it safe to destroy a promise while it's being completed Created: 19/Jun/18  Updated: 29/Oct/23  Resolved: 26/Jul/18

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 4.1.2

Type: New Feature Priority: Major - P3
Reporter: Mira Carey Assignee: ADAM Martin (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Platforms 2018-07-16, Platforms 2018-07-30
Participants:

 Description   

It is a common pattern that we make a promise which on its fulfillment causes the destruction of the promise.

We should make that safe



 Comments   
Comment by Githook User [ 26/Jul/18 ]

Author:

{'username': 'adamlsd', 'name': 'ADAM David Alan Martin', 'email': 'adam.martin@10gen.com'}

Message: SERVER-35683 Make it safe to destroy a promise while completing.

Moving the shared-state pointer for the future out of the promise,
while completing, permits another thread to run the dtor of `Promise`
safely.
Branch: master
https://github.com/mongodb/mongo/commit/f9e2d03e168c6d79bd9b6bc796328b713b69795d

Comment by Githook User [ 26/Jul/18 ]

Author:

{'username': 'adamlsd', 'name': 'ADAM David Alan Martin', 'email': 'adam.martin@10gen.com'}

Message: SERVER-35683 Switch to MongoDB's naming style.

Some members of classes in the `Future` family of types were not
named in accordance with the style guide.
Branch: master
https://github.com/mongodb/mongo/commit/9ef202c2dd723703601e0e42803d71f2d7fb2481

Comment by Mathias Stearn [ 19/Jun/18 ]

While you're in there, please fix Promise's members to use the _normalNamingConvention.

Generated at Thu Feb 08 04:40:37 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.