mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
add polling loop inside shmem_read
This commit is contained in:
parent
cc02829def
commit
37fc5df254
1 changed files with 5 additions and 4 deletions
|
@ -110,14 +110,15 @@ int shmem_read(struct node *n, struct sample *smps[], unsigned cnt)
|
|||
int recv;
|
||||
struct sample *shared_smps[cnt];
|
||||
|
||||
recv = shmem_int_read(&shm->intf, shared_smps, cnt);
|
||||
if (recv < 0)
|
||||
do {
|
||||
recv = shmem_int_read(&shm->intf, shared_smps, cnt);
|
||||
} while (recv == 0);
|
||||
if (recv < 0) {
|
||||
/* This can only really mean that the other process has exited, so close
|
||||
* the interface to make sure the shared memory object is unlinked */
|
||||
shmem_int_close(&shm->intf);
|
||||
|
||||
if (recv <= 0)
|
||||
return recv;
|
||||
}
|
||||
|
||||
sample_copy_many(smps, shared_smps, recv);
|
||||
sample_put_many(shared_smps, recv);
|
||||
|
|
Loading…
Add table
Reference in a new issue