diff options
| author | Andreas Fankhauser hiddenalpha.ch | 2026-01-02 12:16:14 +0100 |
|---|---|---|
| committer | Andreas Fankhauser hiddenalpha.ch | 2026-01-02 12:16:14 +0100 |
| commit | 98d511c55fe8e37ce571fd11c3532a4d533aabbd (patch) | |
| tree | 9695484bedd021d7bb1f6f7cf1530640049d4029 | |
| parent | 2c960b7010f766978c86448b6182a48f1bbf970f (diff) | |
| download | Qntan-98d511c55fe8e37ce571fd11c3532a4d533aabbd.tar.gz Qntan-98d511c55fe8e37ce571fd11c3532a4d533aabbd.zip | |
Make Mutx lock/unlock return int.
| -rw-r--r-- | include/qntan/Qntan.h | 9 |
1 files changed, 7 insertions, 2 deletions
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()` */ }; |
