• Keishi Hattori's avatar
    Revert "Reimplement base::WaitableEvent with a kqueue on Mac." · 3b99851e
    Keishi Hattori authored
    This reverts commit 2096391c.
    
    Reason for revert: Maybe caused jingle_unittests to fail crbug.com/741256
    
    Original change's description:
    > Reimplement base::WaitableEvent with a kqueue on Mac.
    > 
    > For a single WaitableEvent, a custom EVFILT_USER kevent is used to wait and
    > signal. This replaces the default POSIX implementation that uses a
    > pthread_cond_t and a boolean flag.
    > 
    > To implement WaitMany, a new kqueue is created to wait on all the individual
    > WaitableEvent's kqueue descriptor. This replaces a complex locking algorithm
    > used in the default POSIX implementation.
    > 
    > For the asynchronous WaitableEventWatcher, a TYPE_READ dispatch_source_t is
    > used to watch the WaitableEvent's kqueue. This replaces the POSIX
    > implementation of a reference-counted list of async watchers guarded by a lock.
    > 
    > Microbenchmarks show that the kqueue implementation is significantly faster in
    > most cases. The one potential drawback is hitting the low RLIMIT_NOFILE on
    > macOS, since each WaitableEvent and WaitableEventWatcher requires a new
    > descriptor.
    > 
    > Bug: 681167
    > Change-Id: I135012fdd25e547ffb911fc7adc97c203df38241
    > Reviewed-on: https://chromium-review.googlesource.com/553497
    > Reviewed-by: Robert Liao <robliao@chromium.org>
    > Reviewed-by: Mark Mentovai <mark@chromium.org>
    > Commit-Queue: Robert Sesek <rsesek@chromium.org>
    > Cr-Commit-Position: refs/heads/master@{#485788}
    
    TBR=robliao@chromium.org,rsesek@chromium.org,mark@chromium.org
    
    Change-Id: I5b8740bf353f86b0ac5b600793826cd7724cd784
    No-Presubmit: true
    No-Tree-Checks: true
    No-Try: true
    Bug: 681167
    Reviewed-on: https://chromium-review.googlesource.com/566700Reviewed-by: default avatarKeishi Hattori <keishi@chromium.org>
    Commit-Queue: Keishi Hattori <keishi@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#485853}
    3b99851e
waitable_event_watcher.h 4.01 KB