Skip to content

Commit 8d1fdf7

Browse files
authored
Thread join (#305)
* Update to new wait/join api
1 parent 9b50788 commit 8d1fdf7

File tree

6 files changed

+3
-12
lines changed

6 files changed

+3
-12
lines changed

bin/elasticurl/main.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -720,11 +720,6 @@ int main(int argc, char **argv) {
720720
aws_host_resolver_release(resolver);
721721
aws_event_loop_group_release(el_group);
722722

723-
if (aws_global_thread_creator_shutdown_wait_for(5)) {
724-
fprintf(stderr, "Timeout waiting for thread shutdown!");
725-
exit(1);
726-
}
727-
728723
if (tls_ctx) {
729724
aws_tls_connection_options_clean_up(&tls_connection_options);
730725
aws_tls_ctx_release(tls_ctx);

source/http.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,7 @@ void aws_http_library_clean_up(void) {
464464
}
465465
s_library_initialized = false;
466466

467+
aws_thread_join_all_managed();
467468
aws_unregister_error_info(&s_error_list);
468469
aws_unregister_log_subject_info_list(&s_log_subject_list);
469470
s_methods_clean_up();

tests/proxy_test_helper.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ int proxy_tester_clean_up(struct proxy_tester *tester) {
198198

199199
aws_host_resolver_release(tester->host_resolver);
200200
aws_event_loop_group_release(tester->event_loop_group);
201-
ASSERT_SUCCESS(aws_global_thread_creator_shutdown_wait_for(10));
202201

203202
if (tester->tls_ctx) {
204203
aws_tls_connection_options_clean_up(&tester->tls_connection_options);

tests/test_connection.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,6 @@ static int s_tester_clean_up(struct tester *tester) {
327327
aws_client_bootstrap_release(tester->client_bootstrap);
328328
aws_host_resolver_release(tester->host_resolver);
329329
aws_event_loop_group_release(tester->event_loop_group);
330-
ASSERT_SUCCESS(aws_global_thread_creator_shutdown_wait_for(10));
331330

332331
aws_http_library_clean_up();
333332
aws_logger_clean_up(&tester->logger);

tests/test_connection_manager.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,19 +371,18 @@ static int s_cm_tester_clean_up(void) {
371371

372372
aws_host_resolver_release(tester->host_resolver);
373373
aws_event_loop_group_release(tester->event_loop_group);
374-
ASSERT_SUCCESS(aws_global_thread_creator_shutdown_wait_for(10));
375374

376375
aws_tls_ctx_options_clean_up(&tester->tls_ctx_options);
377376
aws_tls_connection_options_clean_up(&tester->tls_connection_options);
378377
aws_tls_ctx_release(tester->tls_ctx);
379378

379+
aws_http_library_clean_up();
380+
380381
aws_mutex_clean_up(&tester->lock);
381382
aws_condition_variable_clean_up(&tester->signal);
382383

383384
aws_mutex_clean_up(&tester->mock_time_lock);
384385

385-
aws_http_library_clean_up();
386-
387386
return AWS_OP_SUCCESS;
388387
}
389388

tests/test_tls.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,6 @@ static int s_test_tls_download_medium_file_general(
213213
aws_host_resolver_release(test.host_resolver);
214214
aws_event_loop_group_release(test.event_loop_group);
215215

216-
ASSERT_SUCCESS(aws_global_thread_creator_shutdown_wait_for(10));
217-
218216
aws_tls_ctx_options_clean_up(&tls_ctx_options);
219217
aws_tls_connection_options_clean_up(&tls_connection_options);
220218
aws_tls_ctx_release(test.tls_ctx);

0 commit comments

Comments
 (0)