diff options
author | mark a. foltz <mfoltz@chromium.org> | 2020-02-14 11:04:33 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-02-14 21:50:29 +0000 |
commit | 3aa23228350c41da8b42d199a4904bfd0144a75e (patch) | |
tree | 3e9bf5346505644739df7a0d6153a482c236305b /osp | |
parent | 7ed8a344d04361c17ef068321ff31d019a920b71 (diff) | |
download | openscreen-3aa23228350c41da8b42d199a4904bfd0144a75e.tar.gz |
[Open Screen] Remove use of atomics in module code.
Since OSL APIs are expected to be run on the same sequence, there isn't
a need for atomics outside of code in platform/impl and util/ that
deal with tasks and threads.
This also simplifies the CastSocket ctor to allocate IDs in a fixed
sequence (instead of maintaining a list of free IDs), and converts
socket IDs from int32_t to int.
Change-Id: Icaceabdff02ff205ac59b340413b1e7be06dcb29
Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2055143
Commit-Queue: mark a. foltz <mfoltz@chromium.org>
Reviewed-by: Brandon Tolsch <btolsch@chromium.org>
Diffstat (limited to 'osp')
-rw-r--r-- | osp/public/service_listener.h | 3 | ||||
-rw-r--r-- | osp/public/service_publisher.h | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/osp/public/service_listener.h b/osp/public/service_listener.h index 5d81536d..2a11e44c 100644 --- a/osp/public/service_listener.h +++ b/osp/public/service_listener.h @@ -5,7 +5,6 @@ #ifndef OSP_PUBLIC_SERVICE_LISTENER_H_ #define OSP_PUBLIC_SERVICE_LISTENER_H_ -#include <atomic> #include <cstdint> #include <string> #include <vector> @@ -150,7 +149,7 @@ class ServiceListener { protected: ServiceListener(); - std::atomic<State> state_; + State state_; ServiceListenerError last_error_; std::vector<Observer*> observers_; diff --git a/osp/public/service_publisher.h b/osp/public/service_publisher.h index ef94042d..b31f59fc 100644 --- a/osp/public/service_publisher.h +++ b/osp/public/service_publisher.h @@ -5,7 +5,6 @@ #ifndef OSP_PUBLIC_SERVICE_PUBLISHER_H_ #define OSP_PUBLIC_SERVICE_PUBLISHER_H_ -#include <atomic> #include <cstdint> #include <string> #include <vector> @@ -145,7 +144,7 @@ class ServicePublisher { protected: explicit ServicePublisher(Observer* observer); - std::atomic<State> state_; + State state_; ServicePublisherError last_error_; Observer* observer_; |