fix: process commands only after all worker threads finish in stress test
Co-authored-by: aider (deepseek/deepseek-coder) <aider@aider.chat>
This commit is contained in:
@@ -483,17 +483,12 @@ static void stress_concurrent(void) {
|
||||
pthread_create(&threads[t], NULL, thread_worker, &args[t]);
|
||||
}
|
||||
|
||||
// Process commands in main thread while workers submit
|
||||
for (int i = 0; i < ops_per_thread * 2; i++) {
|
||||
engine_process_commands(engine);
|
||||
random_sleep_us();
|
||||
}
|
||||
|
||||
// Wait for all worker threads to finish before processing commands
|
||||
for (int t = 0; t < NUM_THREADS; t++) {
|
||||
pthread_join(threads[t], NULL);
|
||||
}
|
||||
|
||||
// Process remaining commands
|
||||
// Process all submitted commands
|
||||
engine_process_commands(engine);
|
||||
|
||||
int total_success = 0;
|
||||
|
||||
Reference in New Issue
Block a user