Max Kellermann <m...@duempel.org> schrieb am Mi., 17. Juni 2015 um 16:29 Uhr:

>
>
> If you return failure, it should also describe why, for example by
> filling out an Error object.
>
>
OK. I think this error object should be passed by the caller to
SetThreadRealtime()? This will require adding an parameter to
SetThreadRealtime(). This will break existing code that calls
SetThreadRealtime, but it seems that SetThreadRealtime is only called from
one place, which I intend to modify anyway to handle the failure condition.


> > + * return value: true on success
>
> Misformatted.  Should use doxygen syntax.
>
> OK. Will change to @return true on success


> > + bool success = true;
>
> Why this variable?
>
> OK, will be cleaner without this variable.


> >  #ifdef __linux__
> >   struct sched_param sched_param;
> >   sched_param.sched_priority = 50;
> > @@ -94,8 +96,9 @@ SetThreadRealtime()
> >   policy |= SCHED_RESET_ON_FORK;
> >  #endif
> >
> > - sched_setscheduler(0, policy, &sched_param);
> > + success = 0==sched_setscheduler(0, policy, &sched_param);
>
>  return sched_setscheduler(...) == 0;
>
> >  #endif
> > + return success; // on non-linux machines we will always pretend it
> worked
>
>  #else
>  return true;
>  #endif
>

OK.
I will prepare a new patch set.
_______________________________________________
mpd-devel mailing list
mpd-devel@musicpd.org
http://mailman.blarg.de/listinfo/mpd-devel

Reply via email to