Skip to content

Commit 633aff2

Browse files
committed
Fix return value
1 parent b393596 commit 633aff2

File tree

1 file changed

+4
-1
lines changed
  • adapter/thread_metric/src

1 file changed

+4
-1
lines changed

adapter/thread_metric/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,10 @@ pub extern "C" fn tm_semaphore_create(sema_id: c_int) -> c_int {
126126
#[no_mangle]
127127
pub extern "C" fn tm_semaphore_get(sema_id: c_int) -> c_int {
128128
let sema = unsafe { TM_SEMAS[sema_id as usize].assume_init_ref() };
129-
sema.acquire_notimeout::<InsertToEnd>() as c_int
129+
if sema.acquire_notimeout::<InsertToEnd>() {
130+
return TM_SUCCESS;
131+
}
132+
TM_ERROR
130133
}
131134

132135
#[no_mangle]

0 commit comments

Comments
 (0)