summaryrefslogtreecommitdiffstats
path: root/otherlibs/threads/scheduler.c
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>1997-08-29 15:05:51 +0000
committerXavier Leroy <xavier.leroy@inria.fr>1997-08-29 15:05:51 +0000
commit891e4e9c276994f0badbc5c9df619afa9183ea32 (patch)
tree99b92f9313075598957524f52d4e4387fbbf50de /otherlibs/threads/scheduler.c
parent0ee4feb9bdd5d2fdbeec6f74a179fabc9a0b0ffc (diff)
Adaptation pour ocamlopt. Verrouillage des channels maintenant fait en C, et plus en ML
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1692 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs/threads/scheduler.c')
-rw-r--r--otherlibs/threads/scheduler.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/otherlibs/threads/scheduler.c b/otherlibs/threads/scheduler.c
index 74e2bfac1..ec2038ff3 100644
--- a/otherlibs/threads/scheduler.c
+++ b/otherlibs/threads/scheduler.c
@@ -124,15 +124,14 @@ static void thread_scan_roots(action)
scanning_action action;
{
thread_t th;
- register value * sp;
+
/* Scan all active descriptors */
(*action)((value) curr_thread, (value *) &curr_thread);
- /* Don't scan curr_thread->sp, this has already been done */
+ /* Don't scan curr_thread->sp, this has already been done.
+ Don't scan local roots either, for the same reason. */
for (th = curr_thread->next; th != curr_thread; th = th->next) {
(*action)((value) th, (value *) &th);
- for (sp = th->sp; sp < th->stack_high; sp++) {
- (*action)(*sp, sp);
- }
+ do_local_roots(action, th->sp, th->stack_high, NULL);
}
/* Hook */
if (prev_scan_roots_hook != NULL) (*prev_scan_roots_hook)(action);
@@ -456,16 +455,17 @@ value thread_select(arg) /* ML */
/* Primitives to implement suspension on buffered channels */
-value thread_inchan_ready(chan) /* ML */
- struct channel * chan;
+value thread_inchan_ready(vchan) /* ML */
+ value vchan;
{
+ struct channel * chan = Channel(vchan);
return Val_bool(chan->curr < chan->max);
}
-value thread_outchan_ready(chan, vsize) /* ML */
- struct channel * chan;
- value vsize;
+value thread_outchan_ready(vchan, vsize) /* ML */
+ value vchan, vsize;
{
+ struct channel * chan = Channel(vchan);
long size = Long_val(vsize);
/* Negative size means we want to flush the buffer entirely */
if (size < 0) {