source: CIVL/mods/dev.civl.abc/examples/link/barrier/concurrency.cvl

main
Last change on this file was aad342c, checked in by Stephen Siegel <siegel@…>, 3 years ago

Performing huge refactor to incorporate ABC, GMC, and SARL into CIVL repo and use Java modules.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5664 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#include <concurrency.cvh>
10
11/* *********************** Types *********************** */
12
13/* A data type representing a global barrier which must be operated by local
14 * barriers. Completes the declaration of this type in civlc-common.h.
15 */
16struct __gbarrier__ {
17 int nprocs;
18 $proc proc_map[]; // initialized as all $proc_null.
19 _Bool in_barrier[]; // initialized as all false.
20 int num_in_barrier; // initialized as 0.
21};
22
23/* A data type representing a global barrier which used for
24 * operating global barriers. The local barrier type has
25 * a handle of a global barrier.
26 * Completes the declaration of this type in civlc-common.h.
27 */
28struct __barrier__ {
29 int place;
30 $gbarrier gbarrier; // initialized as 0.
31};
32
33/* *********************** Functions *********************** */
34
35void $barrier_enter($barrier barrier);
36
37void $barrier_exit($barrier barrier);
38
39void $barrier_call($barrier barrier) {
40 $barrier_enter(barrier);
41 $barrier_exit(barrier);
42}
43
44#endif
Note: See TracBrowser for help on using the repository browser.