Grassroots Infrastructure
The Grassroots Infrastructure is a suite of computing tools to help users and developers use scientific data infrastructure that can easily be interconnected.
sync_data.h
Go to the documentation of this file.
1 /*
2 ** Copyright 2014-2017 The Earlham Institute
3 **
4 ** Licensed under the Apache License, Version 2.0 (the "License");
5 ** you may not use this file except in compliance with the License.
6 ** You may obtain a copy of the License at
7 **
8 ** http://www.apache.org/licenses/LICENSE-2.0
9 **
10 ** Unless required by applicable law or agreed to in writing, software
11 ** distributed under the License is distributed on an "AS IS" BASIS,
12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ** See the License for the specific language governing permissions and
14 ** limitations under the License.
15 */
16 
22 #ifndef GRASSROOTS_TASK_SYNC_DATA_H
23 #define GRASSROOTS_TASK_SYNC_DATA_H
24 
26 #include "typedefs.h"
27 
28 
29 /* forward declaration */
30 
31 struct SyncData;
32 
38 typedef struct SyncData SyncData;
39 
40 #ifdef __cplusplus
41 extern "C"
42 {
43 #endif
44 
45 
53 
54 
61 GRASSROOTS_TASK_API void FreeSyncData (struct SyncData *sync_data_p);
62 
63 
73 GRASSROOTS_TASK_API bool AcquireSyncDataLock (struct SyncData *sync_data_p);
74 
75 
84 GRASSROOTS_TASK_API bool ReleaseSyncDataLock (struct SyncData *sync_data_p);
85 
86 
98 GRASSROOTS_TASK_API void WaitOnSyncData (struct SyncData *sync_data_p, bool (*continue_fn) (void *data_p), void *data_p);
99 
100 
107 GRASSROOTS_TASK_API void SendSyncData (struct SyncData *sync_data_p);
108 
109 
110 
111 #ifdef __cplusplus
112 }
113 #endif
114 
115 
116 #endif /* #ifndef GRASSROOTS_TASK_SYNC_DATA_H */
117 
118 
grassroots_task_library.h
SyncData::WaitOnSyncData
void WaitOnSyncData(struct SyncData *sync_data_p, bool(*continue_fn)(void *data_p), void *data_p)
Wait for a SyncData condition to be met using a given function to check for the condition.
SyncData::AcquireSyncDataLock
bool AcquireSyncDataLock(struct SyncData *sync_data_p)
Lock a SyncData to allow for thread-safe access.
SyncData::AllocateSyncData
struct SyncData * AllocateSyncData(void)
Allocate a SyncData.
SyncData::ReleaseSyncDataLock
bool ReleaseSyncDataLock(struct SyncData *sync_data_p)
Release the lock non a given SyncData.
typedefs.h
GRASSROOTS_TASK_API
#define GRASSROOTS_TASK_API
Definition: grassroots_task_library.h:46
SyncData
A datatype that allows data to be shared between tasks (e.g.
Definition: linux_sync_data.h:30
SyncData::SendSyncData
void SendSyncData(struct SyncData *sync_data_p)
Signal that a condition has been met.
SyncData::FreeSyncData
void FreeSyncData(struct SyncData *sync_data_p)
Free a SyncData.