On Sun, Aug 11, 2013 at 1:31 AM, Andres Freund <andres@anarazel.de> wrote:
> So, I'd suggest something like:
>
> typedef enum BgwHandleStatus {
> BGWH_SUCCESS, /* sucessfully got status */
> BGWH_NOT_YET, /* worker hasn't started yet */
> BGWH_GONE, /* worker had been started, but shut down already */
> BGWH_POSTMASTER_DIED /* well, there you go */
> } BgwHandleStatus;
>
>
> BgwHandleStatus GetBackgroundWorkerPid(BackgroundWorkerHandle *handle, pid_t *pid);
> BgwHandleStatus WaitForBackgroundWorkerStartup(BackgroundWorkerHandle *handle, pid_t *pid);
OK, here's a patch that API. I renamed the constants a bit, because a
process that has stopped is not necessarily gone; it could be
configured for restart. But we can say that it is stopped, at the
moment.
I'm not sure that this API is an improvement. But I think it's OK, if
you prefer it.
...Robert