posix env: assert in rwsem unlock

Instead of ignoring `pthread_rwlock_unlock()` return value assert that is must
succeed.

The function returns an error eg. when there is an attempt to unlock the
resource from a different thread than it was originally locked which is illegal
in userspace.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
Michal Mielewczyk 2022-09-23 07:09:07 +02:00
parent e9a3ebe460
commit ca9d8072df

2
env/posix/ocf_env.h vendored
View File

@ -306,7 +306,7 @@ static inline int env_rwsem_init(env_rwsem *s)
static inline void env_rwsem_up_read(env_rwsem *s)
{
pthread_rwlock_unlock(&s->lock);
ENV_BUG_ON(pthread_rwlock_unlock(&s->lock));
}
static inline void env_rwsem_down_read(env_rwsem *s)