sc_spawn.hh (12993:977fa1dfe9b3) | sc_spawn.hh (13196:4b5ab2c22743) |
---|---|
1/* 2 * Copyright 2018 Google, Inc. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are 6 * met: redistributions of source code must retain the above copyright 7 * notice, this list of conditions and the following disclaimer; 8 * redistributions in binary form must reproduce the above copyright --- 18 unchanged lines hidden (view full) --- 27 * Authors: Gabe Black 28 */ 29 30#ifndef __SYSTEMC_EXT_CORE_SC_SPAWN_HH__ 31#define __SYSTEMC_EXT_CORE_SC_SPAWN_HH__ 32 33#include <vector> 34 | 1/* 2 * Copyright 2018 Google, Inc. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are 6 * met: redistributions of source code must retain the above copyright 7 * notice, this list of conditions and the following disclaimer; 8 * redistributions in binary form must reproduce the above copyright --- 18 unchanged lines hidden (view full) --- 27 * Authors: Gabe Black 28 */ 29 30#ifndef __SYSTEMC_EXT_CORE_SC_SPAWN_HH__ 31#define __SYSTEMC_EXT_CORE_SC_SPAWN_HH__ 32 33#include <vector> 34 |
35#include "sc_join.hh" |
|
35#include "sc_process_handle.hh" 36 37namespace sc_core 38{ 39 40class sc_spawn_options; 41 42} // namespace sc_core --- 118 unchanged lines hidden (view full) --- 161#define sc_ref(r) boost::ref(r) 162#define sc_cref(r) boost::cref(r) 163 164#define SC_FORK \ 165{ \ 166 ::sc_core::sc_process_handle forkees[] = { 167 168#define SC_JOIN \ | 36#include "sc_process_handle.hh" 37 38namespace sc_core 39{ 40 41class sc_spawn_options; 42 43} // namespace sc_core --- 118 unchanged lines hidden (view full) --- 162#define sc_ref(r) boost::ref(r) 163#define sc_cref(r) boost::cref(r) 164 165#define SC_FORK \ 166{ \ 167 ::sc_core::sc_process_handle forkees[] = { 168 169#define SC_JOIN \ |
169 }; /* TODO wait for the forkees. */ \ | 170 }; \ 171 ::sc_core::sc_join join; \ 172 for (int i = 0; i < sizeof(forkees) / sizeof(forkees[0]); i++) \ 173 join.add_process(forkees[i]); \ 174 join.wait(); \ |
170} 171 172// Non-standard | 175} 176 177// Non-standard |
173#define SC_CJOIN SC_JOIN | 178#define SC_CJOIN \ 179 }; \ 180 ::sc_core::sc_join join; \ 181 for (int i = 0; i < sizeof(forkees) / sizeof(forkees[0]); i++) \ 182 join.add_process(forkees[i]); \ 183 join.wait_clocked(); \ 184} |
174 | 185 |
186 |
|
175} // namespace sc_core 176 177namespace sc_unnamed 178{ 179 180typedef int ImplementationDefined; 181extern ImplementationDefined _1; 182extern ImplementationDefined _2; 183extern ImplementationDefined _3; 184extern ImplementationDefined _4; 185extern ImplementationDefined _5; 186extern ImplementationDefined _6; 187extern ImplementationDefined _7; 188extern ImplementationDefined _8; 189extern ImplementationDefined _9; 190 191} // namespace sc_unnamed 192 193#endif //__SYSTEMC_EXT_CORE_SC_SPAWN_HH__ | 187} // namespace sc_core 188 189namespace sc_unnamed 190{ 191 192typedef int ImplementationDefined; 193extern ImplementationDefined _1; 194extern ImplementationDefined _2; 195extern ImplementationDefined _3; 196extern ImplementationDefined _4; 197extern ImplementationDefined _5; 198extern ImplementationDefined _6; 199extern ImplementationDefined _7; 200extern ImplementationDefined _8; 201extern ImplementationDefined _9; 202 203} // namespace sc_unnamed 204 205#endif //__SYSTEMC_EXT_CORE_SC_SPAWN_HH__ |