@@ -29,24 +29,18 @@ static void *
29
29
background_mongoc_bulk_operation_execute (void * data )
30
30
{
31
31
future_t * future = (future_t * ) data ;
32
-
33
- /* copy the future so we can unlock it while calling
34
- * mongoc_bulk_operation_execute
35
- */
36
- future_t * copy = future_new_copy (future );
37
32
future_value_t return_value ;
38
33
39
34
return_value .type = future_value_uint32_t_type ;
40
35
41
36
future_value_set_uint32_t (
42
37
& return_value ,
43
- mongoc_bulk_operation_execute (
44
- future_value_get_mongoc_bulk_operation_ptr (future_get_param ( copy , 0 )),
45
- future_value_get_bson_ptr (future_get_param ( copy , 1 )),
46
- future_value_get_bson_error_ptr (future_get_param ( copy , 2 ))
38
+ mongoc_bulk_operation_execute (
39
+ future_value_get_mongoc_bulk_operation_ptr (future_get_param ( future , 0 )),
40
+ future_value_get_bson_ptr (future_get_param ( future , 1 )),
41
+ future_value_get_bson_error_ptr (future_get_param ( future , 2 ))
47
42
));
48
43
49
- future_destroy (copy );
50
44
future_resolve (future , return_value );
51
45
52
46
return NULL ;
@@ -56,27 +50,21 @@ static void *
56
50
background_mongoc_client_command_simple (void * data )
57
51
{
58
52
future_t * future = (future_t * ) data ;
59
-
60
- /* copy the future so we can unlock it while calling
61
- * mongoc_client_command_simple
62
- */
63
- future_t * copy = future_new_copy (future );
64
53
future_value_t return_value ;
65
54
66
55
return_value .type = future_value_bool_type ;
67
56
68
57
future_value_set_bool (
69
58
& return_value ,
70
- mongoc_client_command_simple (
71
- future_value_get_mongoc_client_ptr (future_get_param ( copy , 0 )),
72
- future_value_get_const_char_ptr (future_get_param ( copy , 1 )),
73
- future_value_get_const_bson_ptr (future_get_param ( copy , 2 )),
74
- future_value_get_const_mongoc_read_prefs_ptr (future_get_param ( copy , 3 )),
75
- future_value_get_bson_ptr (future_get_param ( copy , 4 )),
76
- future_value_get_bson_error_ptr (future_get_param ( copy , 5 ))
59
+ mongoc_client_command_simple (
60
+ future_value_get_mongoc_client_ptr (future_get_param ( future , 0 )),
61
+ future_value_get_const_char_ptr (future_get_param ( future , 1 )),
62
+ future_value_get_const_bson_ptr (future_get_param ( future , 2 )),
63
+ future_value_get_const_mongoc_read_prefs_ptr (future_get_param ( future , 3 )),
64
+ future_value_get_bson_ptr (future_get_param ( future , 4 )),
65
+ future_value_get_bson_error_ptr (future_get_param ( future , 5 ))
77
66
));
78
67
79
- future_destroy (copy );
80
68
future_resolve (future , return_value );
81
69
82
70
return NULL ;
@@ -86,26 +74,20 @@ static void *
86
74
background_mongoc_collection_aggregate (void * data )
87
75
{
88
76
future_t * future = (future_t * ) data ;
89
-
90
- /* copy the future so we can unlock it while calling
91
- * mongoc_collection_aggregate
92
- */
93
- future_t * copy = future_new_copy (future );
94
77
future_value_t return_value ;
95
78
96
79
return_value .type = future_value_mongoc_cursor_ptr_type ;
97
80
98
81
future_value_set_mongoc_cursor_ptr (
99
82
& return_value ,
100
- mongoc_collection_aggregate (
101
- future_value_get_mongoc_collection_ptr (future_get_param ( copy , 0 )),
102
- future_value_get_mongoc_query_flags_t (future_get_param ( copy , 1 )),
103
- future_value_get_const_bson_ptr (future_get_param ( copy , 2 )),
104
- future_value_get_const_bson_ptr (future_get_param ( copy , 3 )),
105
- future_value_get_const_mongoc_read_prefs_ptr (future_get_param ( copy , 4 ))
83
+ mongoc_collection_aggregate (
84
+ future_value_get_mongoc_collection_ptr (future_get_param ( future , 0 )),
85
+ future_value_get_mongoc_query_flags_t (future_get_param ( future , 1 )),
86
+ future_value_get_const_bson_ptr (future_get_param ( future , 2 )),
87
+ future_value_get_const_bson_ptr (future_get_param ( future , 3 )),
88
+ future_value_get_const_mongoc_read_prefs_ptr (future_get_param ( future , 4 ))
106
89
));
107
90
108
- future_destroy (copy );
109
91
future_resolve (future , return_value );
110
92
111
93
return NULL ;
@@ -115,27 +97,21 @@ static void *
115
97
background_mongoc_collection_insert_bulk (void * data )
116
98
{
117
99
future_t * future = (future_t * ) data ;
118
-
119
- /* copy the future so we can unlock it while calling
120
- * mongoc_collection_insert_bulk
121
- */
122
- future_t * copy = future_new_copy (future );
123
100
future_value_t return_value ;
124
101
125
102
return_value .type = future_value_bool_type ;
126
103
127
104
future_value_set_bool (
128
105
& return_value ,
129
- mongoc_collection_insert_bulk (
130
- future_value_get_mongoc_collection_ptr (future_get_param ( copy , 0 )),
131
- future_value_get_mongoc_insert_flags_t (future_get_param ( copy , 1 )),
132
- future_value_get_const_bson_ptr_ptr (future_get_param ( copy , 2 )),
133
- future_value_get_uint32_t (future_get_param ( copy , 3 )),
134
- future_value_get_const_mongoc_write_concern_ptr (future_get_param ( copy , 4 )),
135
- future_value_get_bson_error_ptr (future_get_param ( copy , 5 ))
106
+ mongoc_collection_insert_bulk (
107
+ future_value_get_mongoc_collection_ptr (future_get_param ( future , 0 )),
108
+ future_value_get_mongoc_insert_flags_t (future_get_param ( future , 1 )),
109
+ future_value_get_const_bson_ptr_ptr (future_get_param ( future , 2 )),
110
+ future_value_get_uint32_t (future_get_param ( future , 3 )),
111
+ future_value_get_const_mongoc_write_concern_ptr (future_get_param ( future , 4 )),
112
+ future_value_get_bson_error_ptr (future_get_param ( future , 5 ))
136
113
));
137
114
138
- future_destroy (copy );
139
115
future_resolve (future , return_value );
140
116
141
117
return NULL ;
@@ -145,19 +121,13 @@ static void *
145
121
background_mongoc_cursor_destroy (void * data )
146
122
{
147
123
future_t * future = (future_t * ) data ;
148
-
149
- /* copy the future so we can unlock it while calling
150
- * mongoc_cursor_destroy
151
- */
152
- future_t * copy = future_new_copy (future );
153
124
future_value_t return_value ;
154
125
155
126
return_value .type = future_value_void_type ;
156
127
157
128
mongoc_cursor_destroy (
158
- future_value_get_mongoc_cursor_ptr (future_get_param ( copy , 0 )));
129
+ future_value_get_mongoc_cursor_ptr (future_get_param ( future , 0 )));
159
130
160
- future_destroy (copy );
161
131
future_resolve (future , return_value );
162
132
163
133
return NULL ;
@@ -167,23 +137,17 @@ static void *
167
137
background_mongoc_cursor_next (void * data )
168
138
{
169
139
future_t * future = (future_t * ) data ;
170
-
171
- /* copy the future so we can unlock it while calling
172
- * mongoc_cursor_next
173
- */
174
- future_t * copy = future_new_copy (future );
175
140
future_value_t return_value ;
176
141
177
142
return_value .type = future_value_bool_type ;
178
143
179
144
future_value_set_bool (
180
145
& return_value ,
181
- mongoc_cursor_next (
182
- future_value_get_mongoc_cursor_ptr (future_get_param ( copy , 0 )),
183
- future_value_get_const_bson_ptr_ptr (future_get_param ( copy , 1 ))
146
+ mongoc_cursor_next (
147
+ future_value_get_mongoc_cursor_ptr (future_get_param ( future , 0 )),
148
+ future_value_get_const_bson_ptr_ptr (future_get_param ( future , 1 ))
184
149
));
185
150
186
- future_destroy (copy );
187
151
future_resolve (future , return_value );
188
152
189
153
return NULL ;
@@ -193,23 +157,17 @@ static void *
193
157
background_mongoc_client_get_database_names (void * data )
194
158
{
195
159
future_t * future = (future_t * ) data ;
196
-
197
- /* copy the future so we can unlock it while calling
198
- * mongoc_client_get_database_names
199
- */
200
- future_t * copy = future_new_copy (future );
201
160
future_value_t return_value ;
202
161
203
162
return_value .type = future_value_char_ptr_ptr_type ;
204
163
205
164
future_value_set_char_ptr_ptr (
206
165
& return_value ,
207
- mongoc_client_get_database_names (
208
- future_value_get_mongoc_client_ptr (future_get_param ( copy , 0 )),
209
- future_value_get_bson_error_ptr (future_get_param ( copy , 1 ))
166
+ mongoc_client_get_database_names (
167
+ future_value_get_mongoc_client_ptr (future_get_param ( future , 0 )),
168
+ future_value_get_bson_error_ptr (future_get_param ( future , 1 ))
210
169
));
211
170
212
- future_destroy (copy );
213
171
future_resolve (future , return_value );
214
172
215
173
return NULL ;
@@ -219,23 +177,17 @@ static void *
219
177
background_mongoc_database_get_collection_names (void * data )
220
178
{
221
179
future_t * future = (future_t * ) data ;
222
-
223
- /* copy the future so we can unlock it while calling
224
- * mongoc_database_get_collection_names
225
- */
226
- future_t * copy = future_new_copy (future );
227
180
future_value_t return_value ;
228
181
229
182
return_value .type = future_value_char_ptr_ptr_type ;
230
183
231
184
future_value_set_char_ptr_ptr (
232
185
& return_value ,
233
- mongoc_database_get_collection_names (
234
- future_value_get_mongoc_database_ptr (future_get_param ( copy , 0 )),
235
- future_value_get_bson_error_ptr (future_get_param ( copy , 1 ))
186
+ mongoc_database_get_collection_names (
187
+ future_value_get_mongoc_database_ptr (future_get_param ( future , 0 )),
188
+ future_value_get_bson_error_ptr (future_get_param ( future , 1 ))
236
189
));
237
190
238
- future_destroy (copy );
239
191
future_resolve (future , return_value );
240
192
241
193
return NULL ;
@@ -245,26 +197,20 @@ static void *
245
197
background_mongoc_topology_select (void * data )
246
198
{
247
199
future_t * future = (future_t * ) data ;
248
-
249
- /* copy the future so we can unlock it while calling
250
- * mongoc_topology_select
251
- */
252
- future_t * copy = future_new_copy (future );
253
200
future_value_t return_value ;
254
201
255
202
return_value .type = future_value_mongoc_server_description_ptr_type ;
256
203
257
204
future_value_set_mongoc_server_description_ptr (
258
205
& return_value ,
259
- mongoc_topology_select (
260
- future_value_get_mongoc_topology_ptr (future_get_param ( copy , 0 )),
261
- future_value_get_mongoc_ss_optype_t (future_get_param ( copy , 1 )),
262
- future_value_get_const_mongoc_read_prefs_ptr (future_get_param ( copy , 2 )),
263
- future_value_get_int64_t (future_get_param ( copy , 3 )),
264
- future_value_get_bson_error_ptr (future_get_param ( copy , 4 ))
206
+ mongoc_topology_select (
207
+ future_value_get_mongoc_topology_ptr (future_get_param ( future , 0 )),
208
+ future_value_get_mongoc_ss_optype_t (future_get_param ( future , 1 )),
209
+ future_value_get_const_mongoc_read_prefs_ptr (future_get_param ( future , 2 )),
210
+ future_value_get_int64_t (future_get_param ( future , 3 )),
211
+ future_value_get_bson_error_ptr (future_get_param ( future , 4 ))
265
212
));
266
213
267
- future_destroy (copy );
268
214
future_resolve (future , return_value );
269
215
270
216
return NULL ;
0 commit comments