windows: Fixed hangs
This commit is contained in:
parent
5f32927b63
commit
d699665274
2 changed files with 6 additions and 5 deletions
|
@ -134,9 +134,10 @@ static int get_win_status(HANDLE handle) {
|
|||
#endif
|
||||
|
||||
struct worker_context g_worker_context = {.test = NULL};
|
||||
unsigned long long g_ppid = 0;
|
||||
|
||||
#ifdef VANILLA_WIN32
|
||||
unsigned long long g_ppid = 0;
|
||||
|
||||
struct full_context {
|
||||
struct criterion_test test;
|
||||
struct criterion_test_extra_data test_data;
|
||||
|
@ -209,8 +210,6 @@ static void *chld_pump_thread_main(void *nil) {
|
|||
|
||||
void init_proc_compat(void) {
|
||||
#ifndef VANILLA_WIN32
|
||||
g_ppid = get_process_id();
|
||||
|
||||
child_pump_running = true;
|
||||
int err = pthread_create(&child_pump, NULL, chld_pump_thread_main, NULL);
|
||||
if (err) {
|
||||
|
@ -218,6 +217,8 @@ void init_proc_compat(void) {
|
|||
exit(1);
|
||||
}
|
||||
#else
|
||||
g_ppid = get_process_id();
|
||||
|
||||
InitializeConditionVariable(&wait_cond);
|
||||
InitializeCriticalSection(&wait_sync);
|
||||
wait_threads = 0;
|
||||
|
|
|
@ -386,6 +386,8 @@ static int criterion_run_all_tests_impl(struct criterion_test_set *set) {
|
|||
abort();
|
||||
}
|
||||
|
||||
init_proc_compat();
|
||||
|
||||
g_client_socket = connect_client();
|
||||
if (g_client_socket < 0) {
|
||||
criterion_perror("Could not initialize the message client: %s.\n",
|
||||
|
@ -393,8 +395,6 @@ static int criterion_run_all_tests_impl(struct criterion_test_set *set) {
|
|||
abort();
|
||||
}
|
||||
|
||||
init_proc_compat();
|
||||
|
||||
struct criterion_global_stats *stats = stats_init();
|
||||
run_tests_async(set, stats, sock);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue