projects
/
model-checker.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
model: use proper size_t printf format
[model-checker.git]
/
threads.cc
diff --git
a/threads.cc
b/threads.cc
index 39f049541d69184cc012bcd042f2400208863a3a..ca4b28b1bc850c9ea5bcab709e2d27a9e74e2581 100644
(file)
--- a/
threads.cc
+++ b/
threads.cc
@@
-12,13
+12,13
@@
/** Allocate a stack for a new thread. */
static void * stack_allocate(size_t size)
{
/** Allocate a stack for a new thread. */
static void * stack_allocate(size_t size)
{
- return malloc(size);
+ return
snapshot_
malloc(size);
}
/** Free a stack for a terminated thread. */
static void stack_free(void *stack)
{
}
/** Free a stack for a terminated thread. */
static void stack_free(void *stack)
{
- free(stack);
+
snapshot_
free(stack);
}
/** Return the currently executing thread. */
}
/** Return the currently executing thread. */
@@
-105,7
+105,7
@@
int Thread::swap(ucontext_t *ctxt, Thread *t)
void Thread::complete()
{
if (!is_complete()) {
void Thread::complete()
{
if (!is_complete()) {
- DEBUG("completed thread %d\n",
get_id(
));
+ DEBUG("completed thread %d\n",
id_to_int(get_id()
));
state = THREAD_COMPLETED;
if (stack)
stack_free(stack);
state = THREAD_COMPLETED;
if (stack)
stack_free(stack);
@@
-119,6
+119,7
@@
void Thread::complete()
* @param a The parameter to pass to this function.
*/
Thread::Thread(thrd_t *t, void (*func)(void *), void *a) :
* @param a The parameter to pass to this function.
*/
Thread::Thread(thrd_t *t, void (*func)(void *), void *a) :
+ creation(NULL),
pending(NULL),
start_routine(func),
arg(a),
pending(NULL),
start_routine(func),
arg(a),