mirror of https://github.com/ericonr/erm.git
Style fixes.
- make mutex and cond var static - move some definitions/declarations around
This commit is contained in:
parent
44cb175eb3
commit
e323a9e59e
13
remove.c
13
remove.c
|
@ -27,18 +27,19 @@ struct task {
|
|||
atomic_uint removed_count;
|
||||
};
|
||||
|
||||
struct queue {
|
||||
static struct queue {
|
||||
pthread_mutex_t mtx;
|
||||
pthread_cond_t cond;
|
||||
struct task *tasks;
|
||||
size_t len, size;
|
||||
/* number of free threads */
|
||||
unsigned free;
|
||||
};
|
||||
static struct queue queue = {.mtx = PTHREAD_MUTEX_INITIALIZER, .cond = PTHREAD_COND_INITIALIZER};
|
||||
} queue = {.mtx = PTHREAD_MUTEX_INITIALIZER, .cond = PTHREAD_COND_INITIALIZER};
|
||||
|
||||
pthread_mutex_t fd_mtx = PTHREAD_MUTEX_INITIALIZER;
|
||||
pthread_cond_t fd_cond = PTHREAD_COND_INITIALIZER;
|
||||
static pthread_mutex_t fd_mtx = PTHREAD_MUTEX_INITIALIZER;
|
||||
static pthread_cond_t fd_cond = PTHREAD_COND_INITIALIZER;
|
||||
|
||||
static unsigned nproc;
|
||||
|
||||
static inline void queue_print(struct queue *q)
|
||||
{
|
||||
|
@ -79,8 +80,6 @@ error:
|
|||
return rv;
|
||||
}
|
||||
|
||||
static unsigned nproc;
|
||||
|
||||
static inline int queue_remove(struct queue *q, struct task *t)
|
||||
{
|
||||
int rv = 0;
|
||||
|
|
Loading…
Reference in New Issue