Skip to content

Commit f1b3533

Browse files
wuguanghao3mwilck
authored andcommitted
udev: prevent interruption by thread cancellation
Using mutexes only guarantees no concurrency during normal runtime. However, if a thread is cancelled mid-execution, a libudev API call might be interrupted halfway (partially executed), leaving memory values in an inconsistent or abnormal state. Furthermore, this change aligns with the requirement that libudev interfaces are not thread-safe and must not be called from multiple threads. Additionally, use macros for wrapping all libudev calls with both the mutex and preventing cancellation, to prevent code duplication. Signed-off-by: Wu Guanghao <wuguanghao3@huawei.com> Signed-off-by: Martin Wilck <mwilck@suse.com>
1 parent a2f344a commit f1b3533

1 file changed

Lines changed: 125 additions & 769 deletions

File tree

0 commit comments

Comments
 (0)