Changeset 268570 in webkit


Ignore:
Timestamp:
Oct 15, 2020 6:45:03 PM (4 years ago)
Author:
ddkilzer@apple.com
Message:

v2: WebKit::XPCServiceEventHandler block should call exit() on the main thread
<https://webkit.org/b/217773>
<rdar://problem/70275659>

Reviewed by Geoff Garen.

  • Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:

(WebKit::XPCServiceEventHandler):

  • Use NSRunLoop instead of libdispatch to run code on the main thread since libdispatch can randomly pick a new main thread when exit() is called on the original main thread.
Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r268569 r268570  
     12020-10-15  David Kilzer  <ddkilzer@apple.com>
     2
     3        v2: WebKit::XPCServiceEventHandler block should call exit() on the main thread
     4        <https://webkit.org/b/217773>
     5        <rdar://problem/70275659>
     6
     7        Reviewed by Geoff Garen.
     8
     9        * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
     10        (WebKit::XPCServiceEventHandler):
     11        - Use NSRunLoop instead of libdispatch to run code on the main
     12          thread since libdispatch can randomly pick a new main thread when
     13          exit() is called on the original main thread.
     14
    1152020-10-15  Tim Horton  <timothy_horton@apple.com>
    216
  • trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm

    r267206 r268570  
    5151                RELEASE_LOG_FAULT(IPC, "Exiting: Received XPC event type: %s", event == XPC_ERROR_CONNECTION_INVALID ? "XPC_ERROR_CONNECTION_INVALID" : "XPC_ERROR_TERMINATION_IMMINENT");
    5252                // FIXME: Handle this case more gracefully.
    53                 dispatch_sync(dispatch_get_main_queue(), ^{
     53                [[NSRunLoop mainRunLoop] performBlock:^{
    5454                    exit(EXIT_FAILURE);
    55                 });
     55                }];
    5656            }
    5757        } else {
     
    7878                if (!initializerFunctionPtr) {
    7979                    RELEASE_LOG_FAULT(IPC, "Exiting: Unable to find entry point in WebKit.framework with name: %s", [(__bridge NSString *)entryPointFunctionName UTF8String]);
    80                     dispatch_sync(dispatch_get_main_queue(), ^{
     80                    [[NSRunLoop mainRunLoop] performBlock:^{
    8181                        exit(EXIT_FAILURE);
    82                     });
     82                    }];
    8383                }
    8484
Note: See TracChangeset for help on using the changeset viewer.