projects
/
model-checker.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
At least everything compiles now... Subramanian's changes pushed into main fork...
[model-checker.git]
/
threads.h
diff --git
a/threads.h
b/threads.h
index 69bd115c4a88243657ce8f92088962f97249dccb..b592804db95959445d5c4f967f449121e2d59bad 100644
(file)
--- a/
threads.h
+++ b/
threads.h
@@
-2,9
+2,11
@@
#define __THREADS_H__
#include <ucontext.h>
#define __THREADS_H__
#include <ucontext.h>
-
+#include "mymemory.h"
#include "libthreads.h"
#include "libthreads.h"
+typedef int thread_id_t;
+
#define THREAD_ID_T_NONE -1
typedef enum thread_state {
#define THREAD_ID_T_NONE -1
typedef enum thread_state {
@@
-16,8
+18,6
@@
typedef enum thread_state {
class Thread {
public:
class Thread {
public:
- void * operator new(size_t size);
- void operator delete(void *ptr);
Thread(thrd_t *t, void (*func)(), void *a);
~Thread();
void complete();
Thread(thrd_t *t, void (*func)(), void *a);
~Thread();
void complete();
@@
-29,8
+29,11
@@
public:
void set_state(thread_state s) { state = s; }
thread_id_t get_id();
thrd_t get_thrd_t() { return *user_thread; }
void set_state(thread_state s) { state = s; }
thread_id_t get_id();
thrd_t get_thrd_t() { return *user_thread; }
+ Thread * get_parent() { return parent; }
+ MEMALLOC
private:
int create_context();
private:
int create_context();
+ Thread *parent;
void (*start_routine)();
void *arg;
void (*start_routine)();
void *arg;
@@
-48,4
+51,14
@@
static inline thread_id_t thrd_to_id(thrd_t t)
return t;
}
return t;
}
+static inline thread_id_t int_to_id(int i)
+{
+ return i;
+}
+
+static inline int id_to_int(thread_id_t id)
+{
+ return id;
+}
+
#endif /* __THREADS_H__ */
#endif /* __THREADS_H__ */