From 666be94a71aa8c8a36ace9a8802f396ee9f1d799 Mon Sep 17 00:00:00 2001 From: fuxiaohei Date: Fri, 26 Jul 2024 14:53:27 +0800 Subject: [PATCH] fix describe mismatch in pthread.h --- c/pthread/sync/sync.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/c/pthread/sync/sync.go b/c/pthread/sync/sync.go index 33679a54..8c9ce5db 100644 --- a/c/pthread/sync/sync.go +++ b/c/pthread/sync/sync.go @@ -76,14 +76,18 @@ func (m *Mutex) Init(attr *MutexAttr) c.Int { return 0 } // llgo:link (*Mutex).Destroy C.pthread_mutex_destroy func (m *Mutex) Destroy() {} -// llgo:link (*Mutex).Lock C.pthread_mutex_lock -func (m *Mutex) Lock() {} +func (m *Mutex) Lock() { m.lockInternal() } + +// llgo:link (*Mutex).lockInternal C.pthread_mutex_lock +func (m *Mutex) lockInternal() c.Int { return 0 } // llgo:link (*Mutex).TryLock C.pthread_mutex_trylock func (m *Mutex) TryLock() c.Int { return 0 } -// llgo:link (*Mutex).Unlock C.pthread_mutex_unlock -func (m *Mutex) Unlock() {} +func (m *Mutex) Unlock() { m.unlockInternal() } + +// llgo:link (*Mutex).unlockInternal C.pthread_mutex_unlock +func (m *Mutex) unlockInternal() c.Int { return 0 } // -----------------------------------------------------------------------------