projects
/
c11tester.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
small changes
[c11tester.git]
/
pthread.cc
diff --git
a/pthread.cc
b/pthread.cc
index 50214c34b31d6d578e4d732c11865eab9b3a3a89..e95fb37a3c9b079599b19ca90dd9f00d74fd66b3 100644
(file)
--- a/
pthread.cc
+++ b/
pthread.cc
@@
-24,10
+24,8
@@
int pthread_create(pthread_t *t, const pthread_attr_t * attr,
struct pthread_params params = { start_routine, arg };
struct pthread_params params = { start_routine, arg };
- ModelAction *act = new ModelAction(PTHREAD_CREATE, std::memory_order_seq_cst, t, (uint64_t)¶ms);
-
/* seq_cst is just a 'don't care' parameter */
/* seq_cst is just a 'don't care' parameter */
- model->switch_t
o_master(act
);
+ model->switch_t
hread(new ModelAction(PTHREAD_CREATE, std::memory_order_seq_cst, t, (uint64_t)¶ms)
);
return 0;
}
return 0;
}
@@
-36,7
+34,7
@@
int pthread_join(pthread_t t, void **value_ptr) {
ModelExecution *execution = model->get_execution();
Thread *th = execution->get_pthread(t);
ModelExecution *execution = model->get_execution();
Thread *th = execution->get_pthread(t);
- model->switch_t
o_master
(new ModelAction(PTHREAD_JOIN, std::memory_order_seq_cst, th, id_to_int(th->get_id())));
+ model->switch_t
hread
(new ModelAction(PTHREAD_JOIN, std::memory_order_seq_cst, th, id_to_int(th->get_id())));
if ( value_ptr ) {
// store return value
if ( value_ptr ) {
// store return value
@@
-54,14
+52,14
@@
int pthread_detach(pthread_t t) {
/* Take care of both pthread_yield and c++ thread yield */
int sched_yield() {
/* Take care of both pthread_yield and c++ thread yield */
int sched_yield() {
- model->switch_t
o_master
(new ModelAction(THREAD_YIELD, std::memory_order_seq_cst, thread_current(), VALUE_NONE));
+ model->switch_t
hread
(new ModelAction(THREAD_YIELD, std::memory_order_seq_cst, thread_current(), VALUE_NONE));
return 0;
}
void pthread_exit(void *value_ptr) {
Thread * th = thread_current();
th->set_pthread_return(value_ptr);
return 0;
}
void pthread_exit(void *value_ptr) {
Thread * th = thread_current();
th->set_pthread_return(value_ptr);
- model->switch_t
o_master
(new ModelAction(THREADONLY_FINISH, std::memory_order_seq_cst, th));
+ model->switch_t
hread
(new ModelAction(THREADONLY_FINISH, std::memory_order_seq_cst, th));
//Need to exit so we don't return to the program
real_pthread_exit(NULL);
}
//Need to exit so we don't return to the program
real_pthread_exit(NULL);
}
@@
-216,7
+214,7
@@
int pthread_cond_timedwait(pthread_cond_t *p_cond,
cdsc::snapcondition_variable *v = execution->getCondMap()->get(p_cond);
cdsc::snapmutex *m = execution->getMutexMap()->get(p_mutex);
cdsc::snapcondition_variable *v = execution->getCondMap()->get(p_cond);
cdsc::snapmutex *m = execution->getMutexMap()->get(p_mutex);
- model->switch_t
o_master
(new ModelAction(ATOMIC_TIMEDWAIT, std::memory_order_seq_cst, v, (uint64_t) m));
+ model->switch_t
hread
(new ModelAction(ATOMIC_TIMEDWAIT, std::memory_order_seq_cst, v, (uint64_t) m));
m->lock();
// model_print("Timed_wait is called\n");
m->lock();
// model_print("Timed_wait is called\n");