Changeset 279647 in webkit


Ignore:
Timestamp:
Jul 7, 2021, 10:32:20 AM (4 years ago)
Author:
commit-queue@webkit.org
Message:

XPC services should release their os transaction when given a SIGTERM signal
https://bugs.webkit.org/show_bug.cgi?id=227747
<rdar://72430454>

Patch by Alex Christensen <achristensen@webkit.org> on 2021-07-07
Reviewed by Geoff Garen.

Apparently when you shut down your computer, processes are given a SIGTERM signal and expected to release their os_transaction_t
to indicate that they can now be terminated "cleanly".

  • Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:

(WebKit::XPCServiceInitializer):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r279645 r279647  
     12021-07-07  Alex Christensen  <achristensen@webkit.org>
     2
     3        XPC services should release their os transaction when given a SIGTERM signal
     4        https://bugs.webkit.org/show_bug.cgi?id=227747
     5        <rdar://72430454>
     6
     7        Reviewed by Geoff Garen.
     8
     9        Apparently when you shut down your computer, processes are given a SIGTERM signal and expected to release their os_transaction_t
     10        to indicate that they can now be terminated "cleanly".
     11
     12        * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
     13        (WebKit::XPCServiceInitializer):
     14
    1152021-07-07  Alex Christensen  <achristensen@webkit.org>
    216
  • trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h

    r277710 r279647  
    102102#if PLATFORM(MAC)
    103103    osTransaction() = adoptOSObject(os_transaction_create("WebKit XPC Service"));
     104    signal(SIGTERM, [] (int signal) {
     105        RELEASE_ASSERT(signal == SIGTERM);
     106        osTransaction() = nullptr;
     107    });
    104108#endif
    105109
Note: See TracChangeset for help on using the changeset viewer.