diff options
author | Wim <wim@42.be> | 2022-03-12 23:02:04 +0100 |
---|---|---|
committer | Wim <wim@42.be> | 2022-03-20 14:57:48 +0100 |
commit | aefa70891cfd489fccb8a9567b5bdafb0f863ede (patch) | |
tree | 90fe7c91d7b33b2a1ed08ea3a94840860adc6fc1 /vendor/modernc.org/libc/libc_openbsd.go | |
parent | 1b9877fda45be021ea6a5677c78648cecc19dcd5 (diff) | |
download | matterbridge-msglm-aefa70891cfd489fccb8a9567b5bdafb0f863ede.tar.gz matterbridge-msglm-aefa70891cfd489fccb8a9567b5bdafb0f863ede.tar.bz2 matterbridge-msglm-aefa70891cfd489fccb8a9567b5bdafb0f863ede.zip |
Update vendor (whatsapp)
Diffstat (limited to 'vendor/modernc.org/libc/libc_openbsd.go')
-rw-r--r-- | vendor/modernc.org/libc/libc_openbsd.go | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/vendor/modernc.org/libc/libc_openbsd.go b/vendor/modernc.org/libc/libc_openbsd.go index 2e941341..0ad1a38c 100644 --- a/vendor/modernc.org/libc/libc_openbsd.go +++ b/vendor/modernc.org/libc/libc_openbsd.go @@ -1481,7 +1481,7 @@ func X__xuname(t *TLS, namesize int32, namebuf uintptr) int32 { } // int chflags(const char *path, u_int flags); -func Xchflags(t *TLS, path uintptr, flags uint64) int32 { +func Xchflags(t *TLS, path uintptr, flags uint32) int32 { if err := unix.Chflags(GoString(path), int(flags)); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -1605,3 +1605,29 @@ func X__assert2(t *TLS, file uintptr, line int32, fn, expr uintptr) { func Xgetpagesize(t *TLS) int32 { return int32(unix.Getpagesize()) } + +const PTHREAD_MUTEX_DEFAULT = 0 + +// The pthread_mutex_init() function shall initialize the mutex referenced by +// mutex with attributes specified by attr. If attr is NULL, the default mutex +// attributes are used; the effect shall be the same as passing the address of +// a default mutex attributes object. Upon successful initialization, the state +// of the mutex becomes initialized and unlocked. +// +// If successful, the pthread_mutex_destroy() and pthread_mutex_init() +// functions shall return zero; otherwise, an error number shall be returned to +// indicate the error. +// +// int pthread_mutex_init(pthread_mutex_t *restrict mutex, const pthread_mutexattr_t *restrict attr); +func Xpthread_mutex_init(t *TLS, pMutex, pAttr uintptr) int32 { + typ := PTHREAD_MUTEX_DEFAULT + if pAttr != 0 { + typ = int(X__ccgo_pthreadMutexattrGettype(t, pAttr)) + } + mutexesMu.Lock() + + defer mutexesMu.Unlock() + + mutexes[pMutex] = newMutex(typ) + return 0 +} |