xref: /linux/drivers/md/dm-vdo/thread-utils.h (revision 79790b6818e96c58fe2bffee1b418c16e64e7b80)
1c2f54aa2SMike Snitzer /* SPDX-License-Identifier: GPL-2.0-only */
2c2f54aa2SMike Snitzer /*
3c2f54aa2SMike Snitzer  * Copyright 2023 Red Hat
4c2f54aa2SMike Snitzer  */
5c2f54aa2SMike Snitzer 
6c2f54aa2SMike Snitzer #ifndef THREAD_UTILS_H
7c2f54aa2SMike Snitzer #define THREAD_UTILS_H
8c2f54aa2SMike Snitzer 
9c2f54aa2SMike Snitzer #include <linux/atomic.h>
10c2f54aa2SMike Snitzer 
11650e3107SMike Snitzer /* Thread and synchronization utilities */
12c2f54aa2SMike Snitzer 
13c2f54aa2SMike Snitzer struct thread;
14c2f54aa2SMike Snitzer 
15*7eb30fe1SMatthew Sakai void vdo_initialize_threads_mutex(void);
16650e3107SMike Snitzer int __must_check vdo_create_thread(void (*thread_function)(void *), void *thread_data,
17c2f54aa2SMike Snitzer 				   const char *name, struct thread **new_thread);
18650e3107SMike Snitzer void vdo_join_threads(struct thread *thread);
19c2f54aa2SMike Snitzer 
20c2f54aa2SMike Snitzer #endif /* UDS_THREADS_H */
21