projects
/
c11tester.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
get rid of an unused function
[c11tester.git]
/
threads.cc
diff --git
a/threads.cc
b/threads.cc
index 8d078b51bbfa1a8c0b4bc03b3176afa85f3a4d97..0da9282aa942bd2966bf939d6409636fa99049e5 100644
(file)
--- a/
threads.cc
+++ b/
threads.cc
@@
-13,6
+13,7
@@
/* global "model" object */
#include "model.h"
#include "execution.h"
/* global "model" object */
#include "model.h"
#include "execution.h"
+#include "schedule.h"
#ifdef TLS
#include <dlfcn.h>
#ifdef TLS
#include <dlfcn.h>
@@
-319,10
+320,15
@@
void Thread::complete()
if (stack)
stack_free(stack);
#ifdef TLS
if (stack)
stack_free(stack);
#ifdef TLS
- if (this != model->getInitThread()) {
+ if (this != model->getInitThread()
&& !model->getParams()->threadsnocleanup
) {
modellock = 1;
modellock = 1;
+ ASSERT(thread_current()==NULL);
+ Thread * curr_thread = model->getScheduler()->get_current_thread();
+ //Make any current_thread calls work in code to free
+ model->getScheduler()->set_current_thread(this);
real_pthread_mutex_unlock(&mutex2);
real_pthread_join(thread, NULL);
real_pthread_mutex_unlock(&mutex2);
real_pthread_join(thread, NULL);
+ model->getScheduler()->set_current_thread(curr_thread);
modellock = 0;
}
#endif
modellock = 0;
}
#endif