projects
/
model-checker.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
01237c4
)
libthreads: export thread_yield()
author
Brian Norris
<banorris@uci.edu>
Sat, 10 Mar 2012 03:04:00 +0000
(19:04 -0800)
committer
Brian Norris
<banorris@uci.edu>
Sat, 10 Mar 2012 03:21:29 +0000
(19:21 -0800)
We export this for now. The function will need to change for long-term exported
use though.
libthreads.c
patch
|
blob
|
history
libthreads.h
patch
|
blob
|
history
diff --git
a/libthreads.c
b/libthreads.c
index 8bdd76ea153f58d585c767581635dbca75a711fc..660e19d5d7b06811b6ec52cce76f63bf4d0b29ea 100644
(file)
--- a/
libthreads.c
+++ b/
libthreads.c
@@
-54,7
+54,7
@@
static int thread_swap(struct thread *old, struct thread *new)
return swapcontext(&old->context, &new->context);
}
-
static int thread_yield(
)
+
int thread_yield(void
)
{
struct thread *old, *next;
diff --git
a/libthreads.h
b/libthreads.h
index 0201ea616eb8842f4f3e86a2d7001421a3cb8252..1e2df96292bf365d087d7a7d8fe8cf5405f56b87 100644
(file)
--- a/
libthreads.h
+++ b/
libthreads.h
@@
-14,6
+14,7
@@
struct thread {
int thread_create(struct thread *t, void (*start_routine), void *arg);
void thread_join(struct thread *t);
+int thread_yield(void);
struct thread *thread_current(void);
#endif /* __LIBTHREADS_H__ */