File tree Expand file tree Collapse file tree 4 files changed +8
-0
lines changed
build/future_function_templates Expand file tree Collapse file tree 4 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,8 @@ future_wait (future_t *future)
91
91
mongoc_mutex_unlock (&future->mutex);
92
92
93
93
if (resolved) {
94
+ future->awaited = true;
95
+
94
96
/* free memory */
95
97
mongoc_thread_join (future->thread);
96
98
}
@@ -102,6 +104,7 @@ future_wait (future_t *future)
102
104
void
103
105
future_destroy (future_t *future)
104
106
{
107
+ assert (future->awaited);
105
108
bson_free (future->argv);
106
109
mongoc_cond_destroy (&future->cond);
107
110
mongoc_mutex_destroy (&future->mutex);
Original file line number Diff line number Diff line change 11
11
typedef struct
12
12
{
13
13
bool resolved;
14
+ bool awaited;
14
15
future_value_t return_value;
15
16
int argc;
16
17
future_value_t *argv;
Original file line number Diff line number Diff line change @@ -328,6 +328,8 @@ future_wait (future_t *future)
328
328
mongoc_mutex_unlock (& future -> mutex );
329
329
330
330
if (resolved ) {
331
+ future -> awaited = true;
332
+
331
333
/* free memory */
332
334
mongoc_thread_join (future -> thread );
333
335
}
@@ -339,6 +341,7 @@ future_wait (future_t *future)
339
341
void
340
342
future_destroy (future_t * future )
341
343
{
344
+ assert (future -> awaited );
342
345
bson_free (future -> argv );
343
346
mongoc_cond_destroy (& future -> cond );
344
347
mongoc_mutex_destroy (& future -> mutex );
Original file line number Diff line number Diff line change 17
17
typedef struct
18
18
{
19
19
bool resolved ;
20
+ bool awaited ;
20
21
future_value_t return_value ;
21
22
int argc ;
22
23
future_value_t * argv ;
You can’t perform that action at this time.
0 commit comments