1
0
mirror of https://github.com/SuperBFG7/ympd synced 2024-11-14 10:04:48 +00:00

Fix: set threadnames

This commit is contained in:
jcorporation 2019-01-21 00:20:48 +00:00
parent a73e71e4a9
commit df18a9f970
2 changed files with 6 additions and 1 deletions

View File

@ -22,6 +22,8 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#define _GNU_SOURCE
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
@ -280,10 +282,13 @@ int main(int argc, char **argv) {
pthread_t mpd_client_thread, web_server_thread, mympd_api_thread;
//mpd connection
pthread_create(&mpd_client_thread, NULL, mpd_client_loop, &config);
pthread_setname_np(mpd_client_thread, "mympd_mpdclient");
//webserver
pthread_create(&web_server_thread, NULL, web_server_loop, &mgr);
pthread_setname_np(web_server_thread, "mympd_webserver");
//mympd api
pthread_create(&mympd_api_thread, NULL, mympd_api_loop, &config);
pthread_setname_np(mympd_api_thread, "mympd_mympdapi");
//Outsourced all work to separate threads, do nothing...

View File

@ -100,7 +100,7 @@ void *mympd_api_loop(void *arg_config) {
}
while (s_signal_received == 0) {
struct t_work_request *request = tiny_queue_shift(mympd_api_queue, 100);
struct t_work_request *request = tiny_queue_shift(mympd_api_queue, 0);
if (request != NULL) {
mympd_api(config, &mympd_state, request);
}