gem5: centralize information on simulate() time reached

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-07-25 00:00:00 +00:00
parent 402059ed22
commit 6f5a1a3e83
6 changed files with 138 additions and 10 deletions

View File

@@ -1,4 +1,6 @@
/* count to infinity in n threads.
*
* https://github.com/cirosantilli/linux-kernel-module-cheat#pthreads
*
* Useful if you need to keep several threads around
* to test something.

View File

@@ -0,0 +1,28 @@
/* Let's see a trivial deadlock in action to feel the joys of multithreading.
*
* https://github.com/cirosantilli/linux-kernel-module-cheat#pthreads
*
* Exit successfully immediately without any arguments:
*
* ./pthread_deadlock.out
*
* Hang forever in a deadlock if one argument is given:
*
* ....
* ./pthread_deadlock.out 0
* ....
*/
#define _XOPEN_SOURCE 700
#include <assert.h>
#include <pthread.h>
#include <stdlib.h>
int main(int argc, char **argv) {
pthread_mutex_t main_thread_mutex = PTHREAD_MUTEX_INITIALIZER;
(void)(argv);
pthread_mutex_lock(&main_thread_mutex);
if (argc > 1)
pthread_mutex_lock(&main_thread_mutex);
return EXIT_SUCCESS;
}