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

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.7 KB
Line 
1/* This header file contains the function prototypes for
2 * concurrency.
3 */
4
5#ifdef __CONCURRENCY__
6#else
7#define __CONCURRENCY__
8
9/* includes civlc.cvh because this library references $scope */
10#include <civlc.cvh>
11
12/* ********************************* Types ********************************* */
13
14/* A data type representing a global barrier which must be operated by local
15 * barriers.
16 */
17typedef struct __gbarrier__ * $gbarrier;
18
19/* A data type representing a global barrier which used for
20 * operating global barriers. The local barrier type has
21 * a handle of a global barrier.
22 */
23typedef struct __barrier__ * $barrier;
24
25/* ******************************* Functions ******************************* */
26
27/* Creates a new barrier object and returns a handle to it.
28 * The barrier has the specified size.
29 * The new object will be allocated in the given scope. */
30$gbarrier $gbarrier_create($scope scope, int size);
31
32/* Destroys the gbarrier */
33void $gbarrier_destroy($gbarrier barrier);
34
35/* Creates a new local barrier object and returns a handle to it.
36 * The new barrier will be affiliated with the specified global
37 * barrier. This local barrier handle will be used as an
38 * argument in most barrier functions. The place must be in
39 * [0,size-1] and specifies the place in the global barrier
40 * that will be occupied by the local barrier.
41 * Only one call to $barrier_create may occur for each barrier-place pair.
42 * The new object will be allocated in the given scope. */
43$barrier $barrier_create($scope scope, $gbarrier gbarrier, int place);
44
45/* Destroys the barrier. */
46void $barrier_destroy($barrier barrier);
47
48/* Calls the barrier associated with this local barrier object.*/
49void $barrier_call($barrier barrier);
50
51#endif
Note: See TracBrowser for help on using the repository browser.