Ignore:
Timestamp:
11/09/17 14:00:49 (4 years ago)
Author:
Bayard Gildas
Message:

Added timeout on SharedMem Read

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairCore/src/unexported/SharedMem_impl.h

    r149 r203  
    1818#ifdef __XENO__
    1919#include <native/heap.h>
    20 #include <native/mutex.h>
    21 #else
    22 #include <semaphore.h>
    2320#endif
     21
     22#include <Semaphore.h>
    2423
    2524#include <SharedMem.h>
     
    3736
    3837  void Write(const char *buf, size_t size);
    39   void Read(char *buf, size_t size);
     38  bool Read(char *buf, size_t size, flair::core::Time nsTimeout);
    4039  void ReaderReady();
    4140
     
    4544  size_t size;
    4645  char *mem_segment;
     46  flair::core::Semaphore sem,sem_producer,sem_consumer;
    4747#ifdef __XENO__
    4848  RT_HEAP heap;
    49   RT_MUTEX mutex;
    5049  bool heap_binded;
    51   bool mutex_binded;
    5250#else
    5351  int fd;
    54   sem_t *sem,*sem_producer,*sem_consumer;
    55   std::string sem_name, shm_name;
    56   std::string sem_name_producer,sem_name_consumer;
     52  std::string shm_name;
    5753#endif
    5854};
Note: See TracChangeset for help on using the changeset viewer.