Export/Import NvSciSyncFence
/* signaler*/
NvSciSyncFenceIpcExportDescriptor fenceDesc;
NvSciError err;
/* generate sharedFence */
err = NvSciSyncIpcExportFence(
&sharedFence, /* fence to be exported */
ipcEndpoint, /* should be the same ipcEndpoint used for
communicating the attribute lists */
&fenceDesc); /* fence descriptor has a fixed size and
is only filled in this call */
if (err != NvSciError_Success) {
return err;
}
NvSciSyncFenceClear(&sharedFence);
/* send the descriptor via Ipc */
/* waiter */
/* receive the descriptor fenceDesc */
err = NvSciSyncIpcImportFence(syncObj,
fenceDesc,
&syncFence);
if (err != NvSciError_Success) {
return err;
}
Fences are designed to be small, fixed sized objects, and interactions with them do not involve any runtime allocation. All fence structures and fence descriptors are allocated once at initialization. During runtime, NvSciSync only updates the fence and related structures, as needed.