-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbasicqueue.h
More file actions
36 lines (28 loc) · 751 Bytes
/
basicqueue.h
File metadata and controls
36 lines (28 loc) · 751 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
* basicqueue.h
*
* Created on: Feb 20, 2017
* Author: pnookala
*/
#ifndef BASICQUEUE_H_
#define BASICQUEUE_H_
#include <stdio.h>
#include <stdlib.h>
#include <sys/queue.h>
#include "worker.h"
#include <pthread.h>
CIRCLEQ_HEAD(circleq, basicentry) head;
struct circleq *headp; /* Circular queue head. */
struct basicentry {
CIRCLEQ_ENTRY(basicentry) entries; /* Circular queue. */
struct task_desc* elem;
};
CIRCLEQ_HEAD(circleq_r, basicentry) rq_head;
struct circleq_r *rq_headp; /* Circular queue head. */
pthread_mutex_t lock;
void InitBasicQueue(int size);
void BasicEnqueue(void* task);
void* BasicDequeue();
void BasicEnqueue_rq(void* task);
void* BasicDequeue_rq();
#endif /* BASICQUEUE_H_ */