diff options
author | eivind <eivind@FreeBSD.org> | 1998-11-28 23:52:58 +0000 |
---|---|---|
committer | eivind <eivind@FreeBSD.org> | 1998-11-28 23:52:58 +0000 |
commit | 083b0d7688fa9abeb57de744e997044767be0259 (patch) | |
tree | 5f53d2cbe90934f9d98b0d8ba5cf3407e6fba004 /lib/libpthread/thread/thr_mattr_kind_np.c | |
parent | 9eb948517872cbf893bb6f18d88ff5016b9fd899 (diff) | |
download | FreeBSD-src-083b0d7688fa9abeb57de744e997044767be0259.zip FreeBSD-src-083b0d7688fa9abeb57de744e997044767be0259.tar.gz |
Add support for pthread_mutexattr_settype(). As a side effect of
testing this, fix MUTEX_TYPE_COUNTING_FAST. Recursive locks now work.
Diffstat (limited to 'lib/libpthread/thread/thr_mattr_kind_np.c')
-rw-r--r-- | lib/libpthread/thread/thr_mattr_kind_np.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/libpthread/thread/thr_mattr_kind_np.c b/lib/libpthread/thread/thr_mattr_kind_np.c index 3eeabff..c145a1f 100644 --- a/lib/libpthread/thread/thr_mattr_kind_np.c +++ b/lib/libpthread/thread/thr_mattr_kind_np.c @@ -61,4 +61,18 @@ pthread_mutexattr_getkind_np(pthread_mutexattr_t attr) } return(ret); } + +int +pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type) +{ + int ret; + if (attr == NULL || *attr == NULL || type >= MUTEX_TYPE_MAX) { + errno = EINVAL; + ret = -1; + } else { + (*attr)->m_type = type; + ret = 0; + } + return(ret); +} #endif |