From: Kevin Day Date: Wed, 14 Apr 2021 22:41:18 +0000 (-0500) Subject: Update: f_thread_lock_read_timed() should return F_resource_not. X-Git-Tag: 0.5.3~45 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=71f0a2a47720730818eced0baa3f96a94c7d9bea;p=fll Update: f_thread_lock_read_timed() should return F_resource_not. The pthread_rwlock_timedrdlock() potentially returns EAGAIN. This needs to be handled, translated into F_resource_not (with error bit), and then returned. --- diff --git a/level_0/f_thread/c/thread.c b/level_0/f_thread/c/thread.c index 5f8c9c1..1393298 100644 --- a/level_0/f_thread/c/thread.c +++ b/level_0/f_thread/c/thread.c @@ -1788,6 +1788,7 @@ extern "C" { const int error = pthread_rwlock_timedrdlock(lock, timeout); if (error) { + if (error == EAGAIN) return F_status_set_error(F_resource_not); if (error == EDEADLK) return F_status_set_error(F_deadlock); if (error == EINVAL) return F_status_set_error(F_parameter); if (error == ETIMEDOUT) return F_time; diff --git a/level_0/f_thread/c/thread.h b/level_0/f_thread/c/thread.h index b8acf20..0468882 100644 --- a/level_0/f_thread/c/thread.h +++ b/level_0/f_thread/c/thread.h @@ -2426,6 +2426,7 @@ extern "C" { * * F_deadlock (with error bit) if operation would cause a deadlock. * F_parameter (with error bit) if a parameter is invalid. + * F_resource_not (with error bit) if max number of read locks allowed is reached. * * F_failure (with error bit) on any other error. *