[all-commits] [llvm/llvm-project] 1b9684: [OpenMP] Remove shutdown attempt on Windows proces...

Jonathan Peyton via All-commits all-commits at lists.llvm.org
Mon Feb 22 11:16:26 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1b968467c057df980df214a88cddac74dccff15e
      https://github.com/llvm/llvm-project/commit/1b968467c057df980df214a88cddac74dccff15e
  Author: Peyton, Jonathan L <jonathan.l.peyton at intel.com>
  Date:   2021-02-22 (Mon, 22 Feb 2021)

  Changed paths:
    M openmp/runtime/src/kmp_runtime.cpp

  Log Message:
  -----------
  [OpenMP] Remove shutdown attempt on Windows process detach

Only attempt shutdown if lpReserved is NULL. The Windows documentation
states:
When handling DLL_PROCESS_DETACH, a DLL should free resources such as
heap memory only if the DLL is being unloaded dynamically (the
lpReserved parameter is NULL). If the process is terminating (the
lpReserved parameter is non-NULL), all threads in the process except the
current thread either have exited already or have been explicitly
terminated by a call to the ExitProcess function, which might leave some
process resources such as heaps in an inconsistent state. In this case,
it is not safe for the DLL to clean up the resources. Instead, the DLL
should allow the operating system to reclaim the memory.

Differential Revision: https://reviews.llvm.org/D96750




More information about the All-commits mailing list