diff --git a/api/g3doc/threading_design.md b/api/g3doc/threading_design.md index 868c433abc..20c3539b22 100644 --- a/api/g3doc/threading_design.md +++ b/api/g3doc/threading_design.md @@ -37,7 +37,7 @@ and sequenced task queues. 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 and event handlers like this (pseudocode): -
+```
void ObserverClass::Handler(event) {
if (!called_on_client_thread()) {
dispatch_to_client_thread(bind(handler(event)));
@@ -45,7 +45,7 @@ void ObserverClass::Handler(event) {
}
// Process event, we're now on the right thread
}
-
+```
In the future, the implementation may change to always call the callbacks
and event handlers on the client thread.