Make atomic operation to get sequence numbers 11/181311/1
authorJunghoon Park <jh9216.park@samsung.com>
Tue, 12 Jun 2018 04:01:05 +0000 (13:01 +0900)
committerJunghoon Park <jh9216.park@samsung.com>
Tue, 12 Jun 2018 04:01:05 +0000 (13:01 +0900)
 - C generator

Change-Id: I5cd458d4ef1ac71e4519c1aab4b52ca62763f534
Signed-off-by: Junghoon Park <jh9216.park@samsung.com>
idlc/c_gen/c_proxy_body_gen_cb.h
idlc/c_gen/c_stub_body_gen_cb.h

index f80f848..e03e737 100644 (file)
@@ -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;
index 0a5fe0d..66c96c4 100644 (file)
@@ -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;