source: CIVL/text/include/concurrency.cvl@ c2a3f74

1.23 2.0 main test-branch
Last change on this file since c2a3f74 was 4208097, checked in by Manchun Zheng <zmanchun@…>, 12 years ago

Added separated libraries for civl (including civl implementation and library enabler/evaluator/executor); modified the examples in example/library/civlc accordingly;

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@1326 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/* This file completes the definitions of types and some functions
2 * for concurrency, which are declared in concurrency.cvh.
3 */
4
5#ifdef __CIVLC_CONCURRENCY__
6#else
7#define __CIVLC_CONCURRENCY__
8
9/* *********************** Types *********************** */
10
11/* A data type representing a global barrier which must be operated by local
12 * barriers. Completes the declaration of this type in civlc-common.h.
13 */
14struct __gbarrier__ {
15 int nprocs;
16 $proc proc_map[]; // initialized as all $proc_null.
17 _Bool in_barrier[]; // initialized as all false.
18 int num_in_barrier; // initialized as 0.
19};
20
21/* A data type representing a global barrier which used for
22 * operating global barriers. The local barrier type has
23 * a handle of a global barrier.
24 * Completes the declaration of this type in civlc-common.h.
25 */
26struct __barrier__ {
27 int place;
28 $gbarrier gbarrier; // initialized as 0.
29};
30
31/* *********************** Functions *********************** */
32
33void $barrier_enter($barrier barrier);
34
35void $barrier_exit($barrier barrier);
36
37void $barrier_call($barrier barrier) {
38 $barrier_enter(barrier);
39 $barrier_exit(barrier);
40}
41
42#endif
Note: See TracBrowser for help on using the repository browser.