From: Hwankyu Jhun Date: Thu, 4 Apr 2024 11:25:15 +0000 (+0900) Subject: Fix C Generator for critical section X-Git-Tag: accepted/tizen/6.0/unified/20240408.042658~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1a13d39644be4a1db267588dd6276bb202824c0c;p=platform%2Fcore%2Fappfw%2Ftidl.git Fix C Generator for critical section This patch adjusts locking and unlocking mutex for proxy apps. Change-Id: Icf4a2ca40dc77fdaf915eb4a566fb5a07790c8d9 Signed-off-by: Hwankyu Jhun --- diff --git a/idlc/gen/c_proxy_body_gen.cc b/idlc/gen/c_proxy_body_gen.cc index 7c775f57..86567619 100644 --- a/idlc/gen/c_proxy_body_gen.cc +++ b/idlc/gen/c_proxy_body_gen.cc @@ -513,6 +513,7 @@ std::string CProxyBodyGen::GetMethodReadString(const Interface& inf, const char setter[] = "$$($$, $$);\n"; std::string str; if (decl.GetMethodType() != Declaration::MethodType::SYNC) { + str += "g_rec_mutex_unlock(&h->mutex);" + NLine(1); str += "set_last_result(r);" + NLine(1); return str; } diff --git a/idlc/gen/c_proxy_body_gen_cb.h b/idlc/gen/c_proxy_body_gen_cb.h index dc3e7814..04fb6962 100644 --- a/idlc/gen/c_proxy_body_gen_cb.h +++ b/idlc/gen/c_proxy_body_gen_cb.h @@ -351,6 +351,7 @@ $$ return$$; } $$ + g_rec_mutex_lock(&h->mutex); rpc_port_parcel_create(&parcel); rpc_port_parcel_write_int32(parcel, ##_METHOD_$$); $$ @@ -520,7 +521,6 @@ do { const char CB_RECEIVE_BLOCK[] = R"__c_cb( -g_rec_mutex_lock(&h->mutex); do { rpc_port_parcel_h parcel_received; $$