From 4af6f2b3372445f6f15527506721cb446978a06b Mon Sep 17 00:00:00 2001 From: Harald Alvestrand Date: Mon, 12 Apr 2021 11:47:56 +0000 Subject: [PATCH] Move threading documentation for API into g3doc structure Bug: webrtc:12674 Change-Id: I49bb46b4e505f89ce8d56c469a8995779edf1f28 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/214969 Reviewed-by: Artem Titov Reviewed-by: Tommi Commit-Queue: Harald Alvestrand Cr-Commit-Position: refs/heads/master@{#33690} --- api/g3doc/index.md | 13 +++++++++++++ api/{DESIGN.md => g3doc/threading_design.md} | 8 +++++--- g3doc/sitemap.md | 3 ++- 3 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 api/g3doc/index.md rename api/{DESIGN.md => g3doc/threading_design.md} (94%) diff --git a/api/g3doc/index.md b/api/g3doc/index.md new file mode 100644 index 0000000000..fe8d9b5582 --- /dev/null +++ b/api/g3doc/index.md @@ -0,0 +1,13 @@ + + + +# The WebRTC API + +The public API of the WebRTC library consists of the api/ directory and +its subdirectories. No other files should be depended on by webrtc users. + +Before starting to code against the API, it is important to understand +some basic concepts, such as: + +* Memory management, including webrtc's reference counted objects +* [Thread management](threading_design.md) diff --git a/api/DESIGN.md b/api/g3doc/threading_design.md similarity index 94% rename from api/DESIGN.md rename to api/g3doc/threading_design.md index 0a2f36eb2b..868c433abc 100644 --- a/api/DESIGN.md +++ b/api/g3doc/threading_design.md @@ -1,4 +1,6 @@ -# Design considerations + + +# API Threading Design considerations The header files in this directory form the API to the WebRTC library that is intended for client applications' use. @@ -30,7 +32,7 @@ the two calls. sequential execution - other names for such constructs are task runners and sequenced task queues. -# Client threads and callbacks +## Client threads and callbacks At the moment, the API does not give any guarantee on which thread* the callbacks and events are called on. So it's best to write all callback @@ -47,7 +49,7 @@ void ObserverClass::Handler(event) { In the future, the implementation may change to always call the callbacks and event handlers on the client thread. -# Implementation considerations +## Implementation considerations The C++ classes that are part of the public API are also used to derive classes that form part of the implementation. diff --git a/g3doc/sitemap.md b/g3doc/sitemap.md index 10034d5343..78f11f60dc 100644 --- a/g3doc/sitemap.md +++ b/g3doc/sitemap.md @@ -2,7 +2,8 @@ * How to contribute * Code * [Documentation](/g3doc/how_to_write_documentation.md) -* Public C++ API +* [Public C++ API](/api/g3doc/index.md) + * [Threading](/api/g3doc/threading_design.md) * Implementation * Network * Congestion control and bandwidth estimation