Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cfe5a3b9ba53fba674b45ad476a8a5c8bbfaea95
      
https://github.com/WebKit/WebKit/commit/cfe5a3b9ba53fba674b45ad476a8a5c8bbfaea95
  Author: Jean-Yves Avenard <j...@apple.com>
  Date:   2023-12-11 (Mon, 11 Dec 2023)

  Changed paths:
    M Source/WTF/wtf/FunctionDispatcher.h
    M Source/WTF/wtf/NativePromise.h
    M Source/WTF/wtf/RunLoop.h
    M Source/WTF/wtf/WorkQueue.cpp
    M Source/WTF/wtf/WorkQueue.h

  Log Message:
  -----------
  [WTF] Distinguish SerialFunctionDispatcher that are refcounted and guarantee 
that the function will be run.
https://bugs.webkit.org/show_bug.cgi?id=266199
rdar://119476929

Reviewed by Youenn Fablet.

A SerialFunctionDispatcher has an explicit lifetime, while most implementations
are ref-counted, their API contract do not guarantee that a dispatched function 
would
be run (such as a WorkerThread that can be stopped at any time).

To distinguish those, we create a RefCountedSerialFunctionDispatcher, that is 
both
refcounted and that has an API contract lifetime that matches its owner.

For now, only WorkQueue and RunLoop satisfy the requirement.

NativePromise is modified to take this type as the NativePromise API contract
requires that the settled method be called.

No change in observable behaviour.

* Source/WTF/wtf/FunctionDispatcher.h:
* Source/WTF/wtf/NativePromise.h:
* Source/WTF/wtf/RunLoop.h:
* Source/WTF/wtf/WorkQueue.cpp:
(WTF::WorkQueue::ref const):
(WTF::WorkQueue::deref const):
* Source/WTF/wtf/WorkQueue.h:

Canonical link: https://commits.webkit.org/271860@main


_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to