OSDN Git Service

* gjavah.c (print_class_decls): Fix thinko in arglist
[pf3gnuchains/gcc-fork.git] / libchill / continue.c
1 /* Implement tasking-related runtime actions for CHILL.
2    Copyright (C) 1992,1993 Free Software Foundation, Inc.
3    Author: Wilfried Moser
4
5 This file is part of GNU CC.
6
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING.  If not, write to
19 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
20
21 #include "rtltypes.h"
22 #include "rts.h"
23
24 /*
25  * function __continue
26  *
27  * parameters:
28  *     evaddr     pointer to Eventlocation
29  *     filename   source file name where function gets called
30  *     lineno     linenumber in source file
31  *
32  * returns:
33  *     void
34  *
35  * exceptions:
36  *     none
37  *
38  * abstract:
39  *     implement the CHILL CONTINUE action.
40  */
41
42 void
43 __continue (evaddr, filename, lineno)
44      Event_Queue   **evaddr;
45      char           *filename;
46      int             lineno;
47 {
48   Event_Queue  *ev = *evaddr;
49   Event_Queue  *wrk;
50
51   if (ev == 0)
52     /* nothing to do */
53     return;
54
55   /* search for 1st one is not already continued */
56   while (ev && ev->is_continued)
57     ev = ev->forward;
58   if (!ev)
59     /* all have been continued in that queue, do nothing */
60     return;
61
62   wrk = ev->startlist;
63   while (wrk)
64     {
65       Event_Queue     *tmp = (Event_Queue *)wrk->listhead;
66       
67       while (tmp->forward != wrk)
68         tmp = tmp->forward;
69       tmp->forward = wrk->forward;
70       wrk = wrk->chain;
71     }
72
73   /* so far so good, continue this one */
74   ev->is_continued = 1;
75   ev->who_continued = THIS;
76
77   /* tell the runtime system to activate the process */
78   __continue_that (ev->this, ev->priority, filename, lineno);
79 }
80
81 /* force function print_event to be linked */
82 extern void __print_event ();
83 static EntryPoint pev = __print_event;