The same function now either adds the reader to server
or, if so defined, runs a standalone thread.
Change-Id: I4c546d8e3479b7498c9ed2def85b7f710672b001
if (rs)
return false;
+ const int rr = reader_run(reader);
+ if (rr == 0)
+ return true;
+ if (rr != -ENOENT)
+ return false;
+
const int ra = add_reader_to_server(reader, server);
if (ra < 0)
return false;
int reader_run(struct reader_common *const reader)
{
+ if (!reader->ops->thread_func)
+ return -ENOENT;
+
pthread_t thread;
int r = pthread_create(&thread, NULL, reader->ops->thread_func, reader);
if (r < 0)