Guest User

Untitled

a guest
Apr 24th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. /****************************************************************************/
  2. /** Kevin Webb gtg247r **/
  3. /** Jon Olson gtg620b **/
  4. /****************************************************************************/
  5.  
  6. #ifndef _SHMEM_STUFF_H
  7. #define _SHMEM_STUFF_H
  8.  
  9. #define IPC_KEY_FILE "/"
  10. #define SHM_GLOBAL_KEY 0xf00d
  11. #define SHM_THREAD_KEY 0xf00f
  12.  
  13. #define SHM_BUF_SIZE 512 * 1024
  14.  
  15. #include <pthread.h>
  16.  
  17. typedef struct {
  18. pthread_mutex_t request_mutex;
  19. pthread_cond_t request;
  20. pthread_mutex_t segment_id_mutex;
  21. pthread_cond_t ready;
  22. int requests_pending;
  23. int segment_id;
  24. int segment_count;
  25. } shm_global_t;
  26.  
  27. typedef struct {
  28. pthread_mutex_t mutex;
  29. pthread_cond_t cond;
  30. int done;
  31. size_t data_size;
  32. char data[SHM_BUF_SIZE];
  33. } shm_thread_t;
  34.  
  35. #endif /* _SHMEM_STUFF_H */
Add Comment
Please, Sign In to add comment