Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Annotation of /branches/vis15/src/compiler/target-cpu/fragments/seq-run-initially.in
ViewVC logotype

Annotation of /branches/vis15/src/compiler/target-cpu/fragments/seq-run-initially.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4407 - (view) (download)

1 : jhr 4407 // Run the initially methods of the strands (sequential version)
2 :     //
3 :     void world::run_initially ()
4 :     {
5 :    
6 :     #ifndef DIDEROT_NO_GLOBALS
7 :     globals *glob = this->_globals;
8 :     #endif
9 :    
10 :     uint32_t nStabilizing = 0;
11 :     uint32_t nDying = 0;
12 :     for (int i = 0; i < this->_nstrands; i++) {
13 :     diderot::strand_status sts = static_cast<diderot::strand_status>(this->_status[i]);
14 :     if (sts == diderot::kActive) {
15 :     @STRANDTY@ *self = &this->_state[i];
16 :     sts = @STRAND@_initially(@INITIALLY_ARGS@self);
17 :     switch (sts) {
18 :     case diderot::kStabilize:
19 :     // stabilize the strand's state.
20 :     #ifdef DIDEROT_HAS_STABILIZE
21 :     @STRAND@_stabilize (@STABILIZE_ARGS@self);
22 :     #endif
23 :     this->_status[i] = diderot::kStable;
24 :     nStabilizing++;
25 :     break;
26 :     case diderot::kDie:
27 :     this->_status[i] = diderot::kDead;
28 :     nDying++;
29 :     break;
30 :     default:
31 :     assert (sts == this->_status[i]);
32 :     break;
33 :     }
34 :     }
35 :     }
36 :    
37 :     this->_nactive -= nStabilizing + nDying;
38 :     this->_nstable += nStabilizing;
39 :    
40 :     }

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0