Advertisement
techno-

queue.h con productores

Mar 2nd, 2023
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.51 KB | None | 0 0
  1. #ifndef __QUEUE_H__
  2. #define __QUEUE_H__
  3.  
  4. typedef struct _queue *queue;
  5.  
  6. queue q_create(int size);            // Create a new queue
  7. int   q_elements(queue q);             // number of elements in a queue
  8. int   q_insert(queue q, void *elem); // insert an element into a queue
  9. void *q_remove(queue q);             // remove an element from the queue
  10. void  q_destroy(queue q);             // destroy a queue.
  11. mtx_t * q_mutex(queue q);
  12. cnd_t *q_empty(queue q);
  13. cnd_t *q_full(queue q);
  14. int q_size(queue q);
  15.  
  16. #endif
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement