# HG changeset patch # User Paul Boddie # Date 1615503062 -3600 # Node ID a6b20a126635da78ca6656555d8afb3694695ea1 # Parent b38b7b330d730a3210f0f2b7ad51c875b13784e1 Return thread creation errors when starting server threads. diff -r b38b7b330d73 -r a6b20a126635 resource_server.cc --- a/resource_server.cc Thu Mar 11 23:50:20 2021 +0100 +++ b/resource_server.cc Thu Mar 11 23:51:02 2021 +0100 @@ -52,12 +52,17 @@ { pthread_t thread; pthread_attr_t attr; + long err; pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); resource_init_config(_config, _resource); - pthread_create(&thread, &attr, ipc_server_start_mainloop, _config); + + err = pthread_create(&thread, &attr, ipc_server_start_mainloop, _config); + if (err) + return err; + resource_set_config_threaded(_config, pthread_l4_cap(thread), 1); return resource_start_config(_config, _resource); @@ -122,3 +127,5 @@ ipc_server_finalise_config(config); delete config; } + +// vim: tabstop=2 expandtab shiftwidth=2