| Newsgroups |
gmane.comp.emulators.hercules390.general |
| Message-ID |
<CAPcd4G8_bUKav3=oN3=ox=Zq3vWzt1PoBRboXLpuVT9SchEVrA@mail.gmail.com> |
Why dont you have a look at hscmisc.c around line 145?
" This is the main shutdown processing function. It is NEVER called
directly, but is instead ONLY called by either the 'do_shutdown'
or 'do_shutdown_wait' functions after all CPUs have been stopped.
It is responsible for releasing the device configuration and then
calling the Hercules Dynamic Loader "hdl_shut" function to invoke
all registered "Hercules at-exit/termination functions" (similar
to 'atexit' but unique to Hercules) (to perform any other needed
miscellaneous shutdown related processing).
Only after the above three tasks have been completed (stopping the
CPUs, releasing the device configuration, calling registered term-
ination routines/functions) can Hercules then be safely terminated.
Note too that, *technically*, this function *should* wait for *all*
other threads to finish terminating first before either exiting or
returning back to the caller, *but we don't currently enforce that*
(since that's *really* what hdl_adsc + hdl_shut is designed for!).
At the moment, as long as the three previously mentioned three most
important shutdown tasks have been completed (stop cpus, release
device config, call term funcs), then we consider the brunt of our
shutdown processing to be completed and thus exit (or return back
to the caller to let them exit instead). If there happen to be any
threads still running when that happens, they will be automatically
terminated by the operating sytem as normal when a process exits.
SO... If there are any threads that must be terminated completely
and cleanly before Hercules can safely terminate, then you better
add code to this function to ENSURE that your thread is terminated
properly! (and/or add a call to 'hdl_adsc' at the appropriate place
in the startup sequence). For this purpose, the use of "join_thread"
is *strongly* encouraged as it *ensures* that your thread will not
continue until the thread in question has completely exited first."
IOW, you're complaining about nothing... The system is working as designed.
Joe
On Sat, Jun 22, 2019 at 7:34 AM kerravon86-/[email protected] [hercules-390] <
[email protected]> wrote:
>
>
> ---In [email protected], <joemonk64@...> wrote :
>
> > Just for completeness, so we can say this is
> > neither a hercules nor mvs issue.... Here is
> > the shutdown on my tk4- system.
>
> It is a Hercules issue. Hercules has a race
> condition making it non-deterministic and
> producing an *intermittent* fault, which you
> may or may not be able to reproduce. It
> doesn't even close its own log file cleanly
> (randomly), If you and the developers are
> happy to live with that, so be it, it's free software.
>
> BFN. Paul.
>
>