mirror of
https://github.com/yshui/picom.git
synced 2025-02-17 15:56:21 -05:00
trying to catch rttime kills
This commit is contained in:
parent
2be58f173f
commit
bc77266c02
3 changed files with 13 additions and 1 deletions
|
@ -153,6 +153,8 @@ typedef struct session {
|
|||
ev_signal usr1_signal;
|
||||
/// Signal handler for SIGINT
|
||||
ev_signal int_signal;
|
||||
/// Signal handler for SIGXCPU
|
||||
ev_signal xcpu_signal;
|
||||
|
||||
// === Backend related ===
|
||||
/// backend data
|
||||
|
|
|
@ -1952,6 +1952,12 @@ static void exit_enable(EV_P attr_unused, ev_signal *w, int revents attr_unused)
|
|||
quit(ps);
|
||||
}
|
||||
|
||||
static void
|
||||
handle_xcpu_signal(EV_P attr_unused, ev_signal *w attr_unused, int revents attr_unused) {
|
||||
log_info("Received XCPU signal, aborting...");
|
||||
abort();
|
||||
}
|
||||
|
||||
static void config_file_change_cb(void *_ps) {
|
||||
auto ps = (struct session *)_ps;
|
||||
reset_enable(ps->loop, NULL, 0);
|
||||
|
@ -2486,8 +2492,10 @@ static session_t *session_init(int argc, char **argv, Display *dpy,
|
|||
// Set up SIGUSR1 signal handler to reset program
|
||||
ev_signal_init(&ps->usr1_signal, reset_enable, SIGUSR1);
|
||||
ev_signal_init(&ps->int_signal, exit_enable, SIGINT);
|
||||
ev_signal_init(&ps->xcpu_signal, handle_xcpu_signal, SIGXCPU);
|
||||
ev_signal_start(ps->loop, &ps->usr1_signal);
|
||||
ev_signal_start(ps->loop, &ps->int_signal);
|
||||
ev_signal_start(ps->loop, &ps->xcpu_signal);
|
||||
|
||||
// xcb can read multiple events from the socket when a request with reply is
|
||||
// made.
|
||||
|
|
|
@ -191,7 +191,9 @@ bool rtkit_make_realtime(long thread, int priority) {
|
|||
}
|
||||
new_rlim = old_rlim;
|
||||
new_rlim.rlim_cur = min3(new_rlim.rlim_max, (rlim_t)rttime_usec_max, 100000); // 100ms
|
||||
new_rlim.rlim_max = new_rlim.rlim_cur;
|
||||
new_rlim.rlim_max = (rlim_t)rttime_usec_max;
|
||||
log_info("Setting RLIMIT_RTTIME to: hard: %lld, soft: %lld",
|
||||
(long long)new_rlim.rlim_max, (long long)new_rlim.rlim_cur);
|
||||
if (setrlimit(RLIMIT_RTTIME, &new_rlim) != 0) {
|
||||
log_debug("Couldn't set RLIMIT_RTTIME.");
|
||||
return false;
|
||||
|
|
Loading…
Add table
Reference in a new issue