-
Notifications
You must be signed in to change notification settings - Fork 149
/
tcmur_work.h
30 lines (23 loc) · 662 Bytes
/
tcmur_work.h
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
/*
* Copyright (c) 2020 Red Hat, Inc.
*
* This file is licensed to you under your choice of the GNU Lesser
* General Public License, version 2.1 or any later version (LGPLv2.1 or
* later), or the Apache License 2.0.
*/
#ifndef __TCMU_WORK_H
#define __TCMU_WORK_H
#include <pthread.h>
#include "ccan/list/list.h"
struct tcmu_device;
struct tcmur_work {
pthread_mutex_t lock;
pthread_cond_t cond;
int refcnt;
};
struct tcmur_work *tcmur_create_work(void);
void tcmur_destroy_work(struct tcmur_work *work);
int tcmur_run_work(struct tcmur_work *work, void *data,
void (*work_fn)(void *));
void tcmur_flush_work(struct tcmur_work *work);
#endif