* ExitPostmaster -- cleanup * * Do NOT call exit() directly --- always go through here! */
| 5703 | * Do NOT call exit() directly --- always go through here! |
| 5704 | */ |
| 5705 | static void |
| 5706 | ExitPostmaster(int status) |
| 5707 | { |
| 5708 | #ifdef HAVE_PTHREAD_IS_THREADED_NP |
| 5709 | |
| 5710 | /* |
| 5711 | * There is no known cause for a postmaster to become multithreaded after |
| 5712 | * startup. Recheck to account for the possibility of unknown causes. |
| 5713 | * This message uses LOG level, because an unclean shutdown at this point |
| 5714 | * would usually not look much different from a clean shutdown. |
| 5715 | */ |
| 5716 | if (pthread_is_threaded_np() != 0) |
| 5717 | ereport(LOG, |
| 5718 | (errcode(ERRCODE_INTERNAL_ERROR), |
| 5719 | errmsg_internal("postmaster became multithreaded"), |
| 5720 | errdetail("Please report this to <%s>.", PACKAGE_BUGREPORT))); |
| 5721 | #endif |
| 5722 | |
| 5723 | /* should cleanup shared memory and kill all backends */ |
| 5724 | |
| 5725 | /* |
| 5726 | * Not sure of the semantics here. When the Postmaster dies, should the |
| 5727 | * backends all be killed? probably not. |
| 5728 | * |
| 5729 | * MUST -- vadim 05-10-1999 |
| 5730 | */ |
| 5731 | |
| 5732 | proc_exit(status); |
| 5733 | } |
| 5734 | |
| 5735 | /* |
| 5736 | * sigusr1_handler - handle signal conditions from child processes |
no test coverage detected