mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2025-07-03 08:15:34 +00:00
Do signal masking before thread creation
This commit is contained in:
parent
292a26d6ad
commit
d7ac8654e5
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* This file is part of Moonlight Embedded.
|
||||
*
|
||||
* Copyright (C) 2015 Iwan Timmer
|
||||
* Copyright (C) 2015-2019 Iwan Timmer
|
||||
*
|
||||
* Moonlight is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -87,7 +87,7 @@ void loop_remove_fd(int fd) {
|
||||
}
|
||||
}
|
||||
|
||||
void loop_main() {
|
||||
void loop_init() {
|
||||
main_thread_id = pthread_self();
|
||||
sigset_t sigset;
|
||||
sigemptyset(&sigset);
|
||||
@ -98,8 +98,9 @@ void loop_main() {
|
||||
sigprocmask(SIG_BLOCK, &sigset, NULL);
|
||||
sigFd = signalfd(-1, &sigset, 0);
|
||||
loop_add_fd(sigFd, loop_sig_handler, POLLIN | POLLERR | POLLHUP);
|
||||
}
|
||||
|
||||
//static bool evdev_poll(bool (*handler) (struct input_event*, struct input_device*)) {
|
||||
void loop_main() {
|
||||
while (poll(fds, numFds, -1)) {
|
||||
for (int i=0;i<numFds;i++) {
|
||||
if (fds[i].revents > 0) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* This file is part of Moonlight Embedded.
|
||||
*
|
||||
* Copyright (C) 2015 Iwan Timmer
|
||||
* Copyright (C) 2015-2019 Iwan Timmer
|
||||
*
|
||||
* Moonlight is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -25,4 +25,5 @@ typedef int(*FdHandler)(int fd);
|
||||
void loop_add_fd(int fd, FdHandler handler, int events);
|
||||
void loop_remove_fd(int fd);
|
||||
|
||||
void loop_main();
|
||||
void loop_init();
|
||||
void loop_main();
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* This file is part of Moonlight Embedded.
|
||||
*
|
||||
* Copyright (C) 2015-2017 Iwan Timmer
|
||||
* Copyright (C) 2015-2019 Iwan Timmer
|
||||
*
|
||||
* Moonlight is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -121,6 +121,9 @@ static void stream(PSERVER_DATA server, PCONFIGURATION config, enum platform sys
|
||||
connection_debug = true;
|
||||
}
|
||||
|
||||
if (IS_EMBEDDED(system))
|
||||
loop_init();
|
||||
|
||||
platform_start(system);
|
||||
LiStartConnection(&server->serverInfo, &config->stream, &connection_callbacks, platform_get_video(system), platform_get_audio(system, config->audio_device), NULL, drFlags, config->audio_device, 0);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user