From 98d511c55fe8e37ce571fd11c3532a4d533aabbd Mon Sep 17 00:00:00 2001 From: Andreas Fankhauser hiddenalpha.ch Date: Fri, 2 Jan 2026 12:16:14 +0100 Subject: Make Mutx lock/unlock return int. --- include/qntan/Qntan.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/qntan/Qntan.h b/include/qntan/Qntan.h index 85c55f2..e0bfab7 100644 --- a/include/qntan/Qntan.h +++ b/include/qntan/Qntan.h @@ -837,10 +837,15 @@ struct Qntan_Mutx { /* Same idea as a `pthread_mutex_t`, just using virtual funcs, to * increase overkill and make some people sad :D */ - void (*lock)( struct Qntan_Mutx** ); + int (*lock)( struct Qntan_Mutx** ); /* Like `pthread_mutex_lock()` + * WARN: this call may block if mutx already locked! So make sure you + * either + * NEVER HOLD THE MUTX FOR TOO LONG ANYWHERE, + * or + * only `lock()` from threads where blocking is ok. */ - void (*unlock)( struct Qntan_Mutx** ); + int (*unlock)( struct Qntan_Mutx** ); /* Like `pthread_mutex_unlock()` */ }; -- cgit v1.3.1