synchprobs.h 908 B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef _SYNCHPROBS_H_
  2. #define _SYNCHPROBS_H_
  3. /* enumerated type, for the road intersection problem */
  4. enum Directions
  5. {
  6. north = 0,
  7. east = 1,
  8. south = 2,
  9. west = 3
  10. };
  11. typedef enum Directions Direction;
  12. /* student-implemented functions for the road intersection problem */
  13. void intersection_sync_init(void);
  14. void intersection_sync_cleanup(void);
  15. void intersection_before_entry(Direction origin, Direction destination);
  16. void intersection_after_exit(Direction origin, Direction destination);
  17. /* student-implemented functions for the cat/mouse problem */
  18. void cat_before_eating(unsigned int bowl);
  19. void cat_after_eating(unsigned int bowl);
  20. void mouse_before_eating(unsigned int bowl);
  21. void mouse_after_eating(unsigned int bowl);
  22. void catmouse_sync_init(int bowls);
  23. void catmouse_sync_cleanup(int bowls);
  24. void print_state_on(void);
  25. void print_state_off(void);
  26. #endif /* _SYNCHPROBS_H_ */