mirror of
https://github.com/swaywm/sway.git
synced 2026-04-26 06:46:26 -04:00
Call pthread_sigmask() as early as possible so Xwayland SIGUSR1 is not
caught by threads spawned by shared libraries (like the libMali.so OpenGL driver).
This commit is contained in:
parent
e1c4104d02
commit
ecdb4d7e08
2 changed files with 15 additions and 1 deletions
13
sway/main.c
13
sway/main.c
|
|
@ -214,6 +214,19 @@ void enable_debug_flag(const char *flag) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
|
||||||
|
// Shared libraries (such as libMali.so, the Mali OpenGL
|
||||||
|
// driver) may create their own threads. To ensure that
|
||||||
|
// Xwayland's SIGUSR1 does not hit those threads and kill
|
||||||
|
// sway, we must call pthread_sigmask() as early as possible.
|
||||||
|
// See also weston commit
|
||||||
|
// f59dc1112be50467b7c0f8aeba68f3aa10d36725 which does the
|
||||||
|
// same thing.
|
||||||
|
sigset_t mask;
|
||||||
|
sigemptyset(&mask);
|
||||||
|
sigaddset(&mask, SIGUSR1);
|
||||||
|
pthread_sigmask(SIG_BLOCK, &mask, NULL);
|
||||||
|
|
||||||
static int verbose = 0, debug = 0, validate = 0, allow_unsupported_gpu = 0;
|
static int verbose = 0, debug = 0, validate = 0, allow_unsupported_gpu = 0;
|
||||||
|
|
||||||
static struct option long_options[] = {
|
static struct option long_options[] = {
|
||||||
|
|
|
||||||
|
|
@ -210,5 +210,6 @@ executable(
|
||||||
include_directories: [sway_inc],
|
include_directories: [sway_inc],
|
||||||
dependencies: sway_deps,
|
dependencies: sway_deps,
|
||||||
link_with: [lib_sway_common],
|
link_with: [lib_sway_common],
|
||||||
install: true
|
install: true,
|
||||||
|
link_args : '-lpthread'
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue