It looks like the f_thread_condition_wait() f_thread_condition_wait_timed() functions were not fully written.
Add missing handlers.
The f_thread_condition_wait_timed() was even missing the return case of F_time!
Update the comments as the "time" value is relative to the absolute system clock time.
Add F_dead, F_live, and related.
F_control_group_not,
F_critical,
F_critical_not,
+ F_dead,
+ F_dead_not,
F_deadlock,
F_deadlock_not,
F_descriptor,
F_limit_not,
F_link,
F_link_not,
+ F_live,
+ F_live_not,
F_lock,
F_lock_not,
F_loop,
if (error) {
if (error == EINVAL) return F_status_set_error(F_parameter);
+ if (error == ENOTRECOVERABLE) return F_status_set_error(F_recover_not);
+ if (error == EOWNERDEAD) return F_status_set_error(F_dead);
if (error == EPERM) return F_status_set_error(F_prohibited);
return F_status_set_error(F_failure);
if (error) {
if (error == EINVAL) return F_status_set_error(F_parameter);
+ if (error == ENOTRECOVERABLE) return F_status_set_error(F_recover_not);
+ if (error == EOWNERDEAD) return F_status_set_error(F_dead);
if (error == EPERM) return F_status_set_error(F_prohibited);
+ if (error == ETIMEDOUT) return F_time;
return F_status_set_error(F_failure);
}
if (error == EDEADLK) return F_status_set_error(F_deadlock);
if (error == EINVAL) return F_status_set_error(F_parameter);
if (error == ENOTRECOVERABLE) return F_status_set_error(F_recover_not);
- if (error == EOWNERDEAD) return F_status_set_error(F_thread_not);
+ if (error == EOWNERDEAD) return F_status_set_error(F_dead);
if (error == ETIMEDOUT) return F_time;
return F_status_set_error(F_failure);
if (error == EDEADLK) return F_status_set_error(F_deadlock);
if (error == EINVAL) return F_status_set_error(F_parameter);
if (error == ENOTRECOVERABLE) return F_status_set_error(F_recover_not);
- if (error == EOWNERDEAD) return F_status_set_error(F_thread_not);
+ if (error == EOWNERDEAD) return F_status_set_error(F_dead);
if (error == EPERM) return F_status_set_error(F_prohibited);
return F_status_set_error(F_failure);
* @return
* F_none on success.
*
+ * F_dead (with error bit) if the owning thread terminated while holding the mutex lock (thread is dead).
* F_parameter (with error bit) if a parameter is invalid.
+ * F_prohibited (with error bit) if not allowed to perform the operation (possibly because mutex is not owned by current thread).
+ * F_recover_not (with error bit) if the state protected by the mutex is not recoverable.
*
* F_failure (with error bit) on any other error.
*
*
* @param wait
* The amount of time to wait for.
- * The wait time is relative to the clock, so consider calling clock_gettime() and then adding the amount of wait time.
+ * The wait time is relative to the clock, so consider calling clock_gettime() or gettimeofday() and then adding the amount of wait time.
* @param condition
* The condition to wait on.
* @param mutex
* F_none on success.
* F_time on success, and wait timeout was reached before condition was triggered.
*
+ * F_dead (with error bit) if the owning thread terminated while holding the mutex lock (thread is dead).
* F_parameter (with error bit) if a parameter is invalid.
* F_prohibited (with error bit) if not allowed to perform the operation (possibly because mutex is not owned by current thread).
+ * F_recover_not (with error bit) if the state protected by the mutex is not recoverable.
*
* F_failure (with error bit) on any other error.
*
* The ID of the thread to wait for.
* @param wait
* The amount of time to wait for.
- * The wait time is relative to the clock, so consider calling clock_gettime() and then adding the amount of wait time.
+ * The wait time is relative to the clock, so consider calling clock_gettime() or gettimeofday() and then adding the amount of wait time.
* @param result
* (optional) The data returned by the terminated thread (usually the exist status).
* If the terminated thread is cancelled, then this holds PTHREAD_CANCELED.
* F_prohibited (with error bit) if not allowed to perform the operation.
* F_recover_not (with error bit) if the state protected by the mutex is not recoverable.
* F_resource_not (with error bit) if max mutex locks is reached.
- * F_thread_not (with error bit) if the owning thread terminated while holding the mutex lock (thread is dead).
+ * F_dead (with error bit) if the owning thread terminated while holding the mutex lock (thread is dead).
*
* F_failure (with error bit) on any other error.
*
* F_prohibited (with error bit) if not allowed to perform the operation.
* F_recover_not (with error bit) if the state protected by the mutex is not recoverable (for a "robust" mutex).
* F_resource_not (with error bit) if max mutex locks is reached.
- * F_thread_not (with error bit) if the owning thread terminated while holding the mutex lock (thread is dead).
+ * F_dead (with error bit) if the owning thread terminated while holding the mutex lock (thread is dead).
*
* F_failure (with error bit) on any other error.
*
case F_critical_not:
*string = FL_status_string_critical_not;
break;
+ case F_dead:
+ *string = FL_status_string_dead;
+ break;
+ case F_dead_not:
+ *string = FL_status_string_dead_not;
+ break;
case F_deadlock:
*string = FL_status_string_deadlock;
break;
case F_link_not:
*string = FL_status_string_link_not;
break;
+ case F_live:
+ *string = FL_status_string_live;
+ break;
+ case F_live_not:
+ *string = FL_status_string_live_not;
+ break;
case F_lock:
*string = FL_status_string_lock;
break;
#define FL_status_string_control_group_not "F_control_group_not"
#define FL_status_string_critical "F_critical"
#define FL_status_string_critical_not "F_critical_not"
+ #define FL_status_string_dead "F_dead"
+ #define FL_status_string_dead_not "F_dead_not"
#define FL_status_string_deadlock "F_deadlock"
#define FL_status_string_deadlock_not "F_deadlock_not"
#define FL_status_string_descriptor "F_descriptor"
#define FL_status_string_limit_not "F_limit_not"
#define FL_status_string_link "F_link"
#define FL_status_string_link_not "F_link_not"
+ #define FL_status_string_live "F_live"
+ #define FL_status_string_live_not "F_live_not"
#define FL_status_string_lock "F_lock"
#define FL_status_string_lock_not "F_lock_not"
#define FL_status_string_loop "F_loop"
#define FL_status_string_control_group_not_length 19
#define FL_status_string_critical_length 10
#define FL_status_string_critical_not_length 14
+ #define FL_status_string_dead_length 6
+ #define FL_status_string_dead_not_length 10
#define FL_status_string_deadlock_length 10
#define FL_status_string_deadlock_not_length 14
#define FL_status_string_descriptor_length 12
#define FL_status_string_limit_not_length 11
#define FL_status_string_link_length 6
#define FL_status_string_link_not_length 10
+ #define FL_status_string_live_length 6
+ #define FL_status_string_live_not_length 10
#define FL_status_string_lock_length 6
#define FL_status_string_lock_not_length 10
#define FL_status_string_loop_length 6
return F_none;
}
+ if (fl_string_compare(string, FL_status_string_dead, length, FL_status_string_dead_length) == F_equal_to) {
+ *code = F_dead;
+ return F_none;
+ }
+
+ if (fl_string_compare(string, FL_status_string_dead_not, length, FL_status_string_dead_not_length) == F_equal_to) {
+ *code = F_dead_not;
+ return F_none;
+ }
+
if (fl_string_compare(string, FL_status_string_deadlock, length, FL_status_string_deadlock_length) == F_equal_to) {
*code = F_deadlock;
return F_none;
return F_none;
}
+ if (fl_string_compare(string, FL_status_string_live, length, FL_status_string_live_length) == F_equal_to) {
+ *code = F_live;
+ return F_none;
+ }
+
+ if (fl_string_compare(string, FL_status_string_live_not, length, FL_status_string_live_not_length) == F_equal_to) {
+ *code = F_live_not;
+ return F_none;
+ }
+
if (fl_string_compare(string, FL_status_string_lock, length, FL_status_string_lock_length) == F_equal_to) {
*code = F_lock;
return F_none;