summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunghoon Park <jh9216.park@samsung.com>2018-06-12 13:01:05 +0900
committerJunghoon Park <jh9216.park@samsung.com>2018-06-12 13:01:05 +0900
commitf179692a7867848eee11142f656ad2bb8de20bca (patch)
treee241cbee1fb805ef990db9fe7b34c661f89101d1
parent803b63af8fde20510906de590588e94be1d94be2 (diff)
downloadtidl-f179692a7867848eee11142f656ad2bb8de20bca.tar.gz
tidl-f179692a7867848eee11142f656ad2bb8de20bca.tar.bz2
tidl-f179692a7867848eee11142f656ad2bb8de20bca.zip
Make atomic operation to get sequence numbers
- C generator Change-Id: I5cd458d4ef1ac71e4519c1aab4b52ca62763f534 Signed-off-by: Junghoon Park <jh9216.park@samsung.com>
-rw-r--r--idlc/c_gen/c_proxy_body_gen_cb.h2
-rw-r--r--idlc/c_gen/c_stub_body_gen_cb.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/idlc/c_gen/c_proxy_body_gen_cb.h b/idlc/c_gen/c_proxy_body_gen_cb.h
index f80f848..e03e737 100644
--- a/idlc/c_gen/c_proxy_body_gen_cb.h
+++ b/idlc/c_gen/c_proxy_body_gen_cb.h
@@ -92,7 +92,7 @@ rpc_port_##_h rpc_port_##_create(## callback, bool once, void *user_data)
handle->parcelable.to = __##_to;
handle->parcelable.from= __##_from;
handle->id = $$_DELEGATE_$$;
- handle->seq_id = seq_num++;
+ handle->seq_id = g_atomic_int_add(&seq_num, 1) + 1;
handle->callback = callback;
handle->once = once;
handle->user_data = user_data;
diff --git a/idlc/c_gen/c_stub_body_gen_cb.h b/idlc/c_gen/c_stub_body_gen_cb.h
index 0a5fe0d..66c96c4 100644
--- a/idlc/c_gen/c_stub_body_gen_cb.h
+++ b/idlc/c_gen/c_stub_body_gen_cb.h
@@ -239,7 +239,7 @@ int rpc_port_##_create(rpc_port_##_h *h)
handle->parcelable.to = __##_to;
handle->parcelable.from = __##_from;
handle->id = $$_DELEGATE_$$;
- handle->seq_id = seq_num++;
+ handle->seq_id = g_atomic_int_add(&seq_num, 1) + 1;
handle->once = false;
handle->valid = true;