Comment on gem5's broken GDB on secondary core

Try to assert on all C programs if thread creation failed. C++ already
throws by default.
This commit is contained in:
Ciro Santilli 六四事件 法轮功
2020-06-11 01:00:00 +00:00
parent 0a3ce2f41f
commit ce3ea9faea
4 changed files with 23 additions and 6 deletions

View File

@@ -43,8 +43,8 @@ int main(void) {
enum NUM_THREADS {NUM_THREADS = 2};
pthread_t threads[NUM_THREADS];
int thread_args[NUM_THREADS];
pthread_create(&threads[0], NULL, main_thread_0, (void*)&thread_args[0]);
pthread_create(&threads[1], NULL, main_thread_1, (void*)&thread_args[1]);
assert(!pthread_create(&threads[0], NULL, main_thread_0, (void*)&thread_args[0]));
assert(!pthread_create(&threads[1], NULL, main_thread_1, (void*)&thread_args[1]));
pthread_join(threads[0], NULL);
pthread_join(threads[1], NULL);
return EXIT_SUCCESS;