diff options
author | Junghoon Park <jh9216.park@samsung.com> | 2018-06-11 19:46:16 +0900 |
---|---|---|
committer | Junghoon Park <jh9216.park@samsung.com> | 2018-06-11 19:46:16 +0900 |
commit | 803b63af8fde20510906de590588e94be1d94be2 (patch) | |
tree | cf8a4b9c1f9f9c6dfb62c5e47c8737fc06910bfe /idlc | |
parent | 3ec1d67721e74e0c79339992b2083845e6a98491 (diff) | |
download | tidl-803b63af8fde20510906de590588e94be1d94be2.tar.gz tidl-803b63af8fde20510906de590588e94be1d94be2.tar.bz2 tidl-803b63af8fde20510906de590588e94be1d94be2.zip |
Make atomic operation to get sequence numbers
Change-Id: I4834cc0c7e826094a628e91af7572b3112cb8e72
Signed-off-by: Junghoon Park <jh9216.park@samsung.com>
Diffstat (limited to 'idlc')
-rw-r--r-- | idlc/cpp_gen/cpp_gen_base_cb.h | 4 | ||||
-rw-r--r-- | idlc/cpp_gen/cpp_proxy_header_gen_cb.h | 1 | ||||
-rw-r--r-- | idlc/cpp_gen/cpp_stub_header_gen_cb.h | 1 |
3 files changed, 4 insertions, 2 deletions
diff --git a/idlc/cpp_gen/cpp_gen_base_cb.h b/idlc/cpp_gen/cpp_gen_base_cb.h index 76fc3c0..4dc00d6 100644 --- a/idlc/cpp_gen/cpp_gen_base_cb.h +++ b/idlc/cpp_gen/cpp_gen_base_cb.h @@ -61,7 +61,7 @@ const char CB_BUNDLE[] = R"__cls_bundle(class Bundle final { const char CB_CALLBACK_BASE[] = R"__cpp_cb( -int ##::CallbackBase::seq_num_ = 0; +std::atomic<int> ##::CallbackBase::seq_num_ { 0 }; ##::CallbackBase::CallbackBase(int delegate_id, bool once) : id_(delegate_id), once_(once) { @@ -140,7 +140,7 @@ R"__cpp_cb( friend rpc_port_parcel_h operator << (rpc_port_parcel_h h, const CallbackBase& cb); friend rpc_port_parcel_h operator >> (rpc_port_parcel_h h, CallbackBase& cb); - static int seq_num_; + static std::atomic<int> seq_num_; int id_; int seq_id_; bool once_; diff --git a/idlc/cpp_gen/cpp_proxy_header_gen_cb.h b/idlc/cpp_gen/cpp_proxy_header_gen_cb.h index 82bb804..292b7db 100644 --- a/idlc/cpp_gen/cpp_proxy_header_gen_cb.h +++ b/idlc/cpp_gen/cpp_proxy_header_gen_cb.h @@ -116,6 +116,7 @@ R"__cpp_cb( #include <memory> #include <mutex> #include <list> +#include <atomic> )__cpp_cb"; diff --git a/idlc/cpp_gen/cpp_stub_header_gen_cb.h b/idlc/cpp_gen/cpp_stub_header_gen_cb.h index 4e65ec3..8cb4c1f 100644 --- a/idlc/cpp_gen/cpp_stub_header_gen_cb.h +++ b/idlc/cpp_gen/cpp_stub_header_gen_cb.h @@ -123,6 +123,7 @@ R"__cpp_cb( #include <string> #include <vector> #include <list> +#include <atomic> )__cpp_cb"; |