This repository has been archived by the owner on Mar 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix 100% CPU and switch to non-blocking IO
Port #21 on top of the latest `master` > - Migration from `pthread` to `libuv`. > - Fix 100% CPU usage (using `poll()`): > source > > ``` c > /** > * udev_monitor_receive_device: > * @udev_monitor: udev monitor > ... > * The monitor socket is by default set to NONBLOCK. A variant of poll() on > * the file descriptor returned by udev_monitor_get_fd() should to be used to > * wake up when new devices arrive, or alternatively the file descriptor > * switched into blocking mode. > ... > **/ > ``` > - Out of the loop when receives SIGINT or SIGTERM signals for accurate completion of the program > - Fix some ome memory leaks > > ``` c > udev_monitor_unref(mon); > udev_unref(udev); > ``` > - For local functions and variables using the keyword `static` > > #21 (comment)
- Loading branch information
1 parent
eaa8b60
commit 174f543
Showing
1 changed file
with
89 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters