The LIBC pthread implementations fail to provide a way to truly verify that thread data is properly allocated or not.
The full thread types have two different thread related memory freeing functions.
If the first function fails, then the second structure is still allocated.
The previous behavior provided no way to distinguish between the two different failures.
These more granular status codes allow for such distinction now.
This allows the caller to manually try to de-allocate other parts even if the first de-allocation failed.
if (error == EBUSY) return F_status_set_error(F_busy);
if (error == EINVAL) return F_status_set_error(F_parameter);
- return F_status_set_error(F_failure);
+ return F_status_set_error(F_barrier);
}
}
- return pthread_barrierattr_destroy(&full->attribute) ? F_status_set_error(F_failure) : F_okay;
+ return pthread_barrierattr_destroy(&full->attribute) ? F_status_set_error(F_attribute) : F_okay;
}
#endif // _di_f_thread_barrier_full_delete_
* The pthread_barrier_destroy() and pthread_barrierattr_destroy() functions have no distinction like the *_destroy() and the *_delete() used by the FLL project.
* Therefore there is only this function for both deleting and destroying.
*
+ * When F_barrier (with error bit) is returned, then pthread_barrierattr_destroy() is not called.
+ *
* @param full
* The thread barrier_fulls to delete.
*
* @return
* F_okay on success.
*
- * F_busy (with error bit) if a barrier is busy.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_busy (with error bit) if a barrier is busy when calling pthread_barrier_destroy().
+ * F_parameter (with error bit) if a parameter is invalid (including parameter error when calling calling pthread_barrier_destroy().
*
- * F_failure (with error bit) on any other error.
+ * F_attribute (with error bit) on error when calling pthread_barrierattr_destroy().
+ * F_barrier (with error bit) on any error when calling pthread_barrier_destroy().
*
* @see pthread_barrier_destroy()
* @see pthread_barrierattr_destroy()
if (error == EBUSY) return F_status_set_error(F_busy);
if (error == EINVAL) return F_status_set_error(F_parameter);
- return F_status_set_error(F_failure);
+ return F_status_set_error(F_barrier);
}
- if (pthread_barrierattr_destroy(&array[i].attribute)) return F_status_set_error(F_failure);
+ if (pthread_barrierattr_destroy(&array[i].attribute)) return F_status_set_error(F_attribute);
} // for
return F_okay;
if (error == EBUSY) return F_status_set_error(F_busy);
if (error == EINVAL) return F_status_set_error(F_parameter);
- return F_status_set_error(F_failure);
+ return F_status_set_error(F_barrier);
}
- if (pthread_barrierattr_destroy(&array[i].attribute)) return F_status_set_error(F_failure);
+ if (pthread_barrierattr_destroy(&array[i].attribute)) return F_status_set_error(F_attribute);
} // for
return F_okay;
*
* This does not do parameter checking.
*
+ * When F_barrier (with error bit) is returned, then pthread_barrierattr_destroy() is not called.
+ * On any error, the array is not guaranteed to be completely processed.
+ *
* @param start
* The inclusive start position in the array to start deleting.
* @param stop
* @return
* F_okay on success.
*
- * F_busy (with error bit) if a barrier is busy.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_busy (with error bit) if a barrier is busy when calling pthread_barrier_destroy().
+ * F_parameter (with error bit) if a parameter is invalid (including parameter error when calling calling pthread_barrier_destroy().
+ *
+ * F_attribute (with error bit) on error when calling pthread_barrierattr_destroy().
+ * F_barrier (with error bit) on any error when calling pthread_barrier_destroy().
*
* Errors (with error bit) from: f_memory_array_resize().
*
* @see f_memory_array_resize()
- * @see f_memory_arrays_resize()
*
* @see pthread_barrier_destroy()
* @see pthread_barrierattr_destroy()
*
* This does not do parameter checking.
*
+ * When F_barrier (with error bit) is returned, then pthread_barrierattr_destroy() is not called.
+ * On any error, the array is not guaranteed to be completely processed.
+ *
* @param start
* The inclusive start position in the array to start deleting.
* @param stop
* @return
* F_okay on success.
*
- * F_busy (with error bit) if a barrier is busy.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_busy (with error bit) if a barrier is busy when calling pthread_barrier_destroy().
+ * F_parameter (with error bit) if a parameter is invalid (including parameter error when calling calling pthread_barrier_destroy().
+ *
+ * F_attribute (with error bit) on error when calling pthread_barrierattr_destroy().
+ * F_barrier (with error bit) on any error when calling pthread_barrier_destroy().
*
* Errors (with error bit) from: f_memory_array_adjust().
*
* @see f_memory_array_adjust()
- * @see f_memory_arrays_adjust()
*
* @see pthread_barrier_destroy()
* @see pthread_barrierattr_destroy()
if (error == EBUSY) return F_status_set_error(F_busy);
if (error == EINVAL) return F_status_set_error(F_parameter);
- return F_status_set_error(F_failure);
+ return F_status_set_error(F_barrier);
}
- if (pthread_barrierattr_destroy(&array[i].array[j].attribute)) return F_status_set_error(F_failure);
+ if (pthread_barrierattr_destroy(&array[i].array[j].attribute)) return F_status_set_error(F_attribute);
} // for
if (array[i].size && array[i].array) {
if (error == EBUSY) return F_status_set_error(F_busy);
if (error == EINVAL) return F_status_set_error(F_parameter);
- return F_status_set_error(F_failure);
+ return F_status_set_error(F_barrier);
}
- if (pthread_barrierattr_destroy(&array[i].array[j].attribute)) return F_status_set_error(F_failure);
+ if (pthread_barrierattr_destroy(&array[i].array[j].attribute)) return F_status_set_error(F_attribute);
} // for
if (array[i].size && array[i].array) {
*
* This does not do parameter checking.
*
+ * When F_barrier (with error bit) is returned, then pthread_barrierattr_destroy() is not called.
+ * When F_attribute or F_barrier (with error bits) is returned, then f_memory_array_resize() is not called.
+ * On any error, the array is not guaranteed to be completely processed.
+ *
* @param start
* The inclusive start position in the array to start deleting.
* @param stop
* @return
* F_okay on success.
*
- * F_busy (with error bit) if a barrier is busy.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_busy (with error bit) if a barrier is busy when calling pthread_barrier_destroy().
+ * F_parameter (with error bit) if a parameter is invalid (including parameter error when calling calling pthread_barrier_destroy().
+ *
+ * F_attribute (with error bit) on error when calling pthread_barrierattr_destroy().
+ * F_barrier (with error bit) on any error when calling pthread_barrier_destroy().
*
* Errors (with error bit) from: f_memory_array_resize().
*
* @see f_memory_array_resize()
- * @see f_memory_arrays_resize()
*
* @see pthread_barrier_destroy()
* @see pthread_barrierattr_destroy()
*
* This does not do parameter checking.
*
+ * When F_barrier (with error bit) is returned, then pthread_barrierattr_destroy() is not called.
+ * When F_attribute or F_barrier (with error bits) is returned, then f_memory_array_resize() is not called.
+ * On any error, the array is not guaranteed to be completely processed.
+ *
* @param start
* The inclusive start position in the array to start deleting.
* @param stop
* @return
* F_okay on success.
*
- * F_busy (with error bit) if a barrier is busy.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_busy (with error bit) if a barrier is busy when calling pthread_barrier_destroy().
+ * F_parameter (with error bit) if a parameter is invalid (including parameter error when calling calling pthread_barrier_destroy().
+ *
+ * F_attribute (with error bit) on error when calling pthread_barrierattr_destroy().
+ * F_barrier (with error bit) on any error when calling pthread_barrier_destroy().
*
* Errors (with error bit) from: f_memory_array_adjust().
*
* @see f_memory_array_adjust()
- * @see f_memory_arrays_adjust()
*
* @see pthread_barrier_destroy()
* @see pthread_barrierattr_destroy()
if (error == EBUSY) return F_status_set_error(F_busy);
if (error == EINVAL) return F_status_set_error(F_parameter);
- return F_status_set_error(F_failure);
+ return F_status_set_error(F_condition);
}
}
- return pthread_condattr_destroy(&full->attribute) ? F_status_set_error(F_failure) : F_okay;
+ return pthread_condattr_destroy(&full->attribute) ? F_status_set_error(F_attribute) : F_okay;
}
#endif // _di_f_thread_condition_full_delete_
* The pthread_condattr_destroy() and pthread_condattr_destroy() functions have no distinction like the *_destroy() and the *_delete() used by the FLL project.
* Therefore there is only this function for both deleting and destroying.
*
+ * When F_barrier (with error bit) is returned, then pthread_condattr_destroy() is not called.
+ *
* @param full
* The full to delete.
*
* @return
* F_okay on success.
*
- * F_busy (with error bit) if the full is busy.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_busy (with error bit) if a condition is busy when calling pthread_cond_destroy().
+ * F_parameter (with error bit) if a parameter is invalid (including parameter error when calling calling pthread_cond_destroy().
*
- * F_failure (with error bit) on any other error.
+ * F_attribute (with error bit) on error when calling pthread_condattr_destroy().
+ * F_condition (with error bit) on any error when calling pthread_cond_destroy().
*
* @see pthread_cond_destroy()
* @see pthread_condattr_destroy()
if (error == EBUSY) return F_status_set_error(F_busy);
if (error == EINVAL) return F_status_set_error(F_parameter);
- return F_status_set_error(F_failure);
+ return F_status_set_error(F_condition);
}
- if (pthread_condattr_destroy(&array[i].attribute)) return F_status_set_error(F_failure);
+ if (pthread_condattr_destroy(&array[i].attribute)) return F_status_set_error(F_attribute);
} // for
return F_okay;
if (error == EBUSY) return F_status_set_error(F_busy);
if (error == EINVAL) return F_status_set_error(F_parameter);
- return F_status_set_error(F_failure);
+ return F_status_set_error(F_condition);
}
- if (pthread_condattr_destroy(&array[i].attribute)) return F_status_set_error(F_failure);
+ if (pthread_condattr_destroy(&array[i].attribute)) return F_status_set_error(F_attribute);
} // for
return F_okay;
*
* This does not do parameter checking.
*
+ * When F_condition (with error bit) is returned, then pthread_condattr_destroy() is not called.
+ * When F_attribute or F_condition (with error bits) is returned, then f_memory_array_resize() is not called.
+ * On any error, the array is not guaranteed to be completely processed.
+ *
* @param start
* The inclusive start position in the array to start deleting.
* @param stop
* @return
* F_okay on success.
*
- * F_busy (with error bit) if a condition is busy.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_busy (with error bit) if a condition is busy when calling pthread_cond_destroy().
+ * F_parameter (with error bit) if a parameter is invalid (including parameter error when calling calling pthread_cond_destroy().
+ *
+ * F_attribute (with error bit) on error when calling pthread_condattr_destroy().
+ * F_condition (with error bit) on any error when calling pthread_cond_destroy().
*
* Errors (with error bit) from: f_memory_array_resize().
*
* @see f_memory_array_resize()
- * @see f_memory_arrays_resize()
*
* @see pthread_cond_destroy()
* @see pthread_condattr_destroy()
*
* This does not do parameter checking.
*
+ * When F_condition (with error bit) is returned, then pthread_condattr_destroy() is not called.
+ * When F_attribute or F_condition (with error bits) is returned, then f_memory_array_resize() is not called.
+ * On any error, the array is not guaranteed to be completely processed.
+ *
* @param start
* The inclusive start position in the array to start deleting.
* @param stop
* @return
* F_okay on success.
*
- * F_busy (with error bit) if a condition is busy.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_busy (with error bit) if a condition is busy when calling pthread_cond_destroy().
+ * F_parameter (with error bit) if a parameter is invalid (including parameter error when calling calling pthread_cond_destroy().
+ *
+ * F_attribute (with error bit) on error when calling pthread_condattr_destroy().
+ * F_condition (with error bit) on any error when calling pthread_cond_destroy().
*
* Errors (with error bit) from: f_memory_array_adjust().
*
* @see f_memory_array_adjust()
- * @see f_memory_arrays_adjust()
*
* @see pthread_cond_destroy()
* @see pthread_condattr_destroy()
if (error == EBUSY) return F_status_set_error(F_busy);
if (error == EINVAL) return F_status_set_error(F_parameter);
- return F_status_set_error(F_failure);
+ return F_status_set_error(F_condition);
}
- if (pthread_condattr_destroy(&array[i].array[j].attribute)) return F_status_set_error(F_failure);
+ if (pthread_condattr_destroy(&array[i].array[j].attribute)) return F_status_set_error(F_attribute);
} // for
if (array[i].size && array[i].array) {
if (error == EBUSY) return F_status_set_error(F_busy);
if (error == EINVAL) return F_status_set_error(F_parameter);
- return F_status_set_error(F_failure);
+ return F_status_set_error(F_condition);
}
- if (pthread_condattr_destroy(&array[i].array[j].attribute)) return F_status_set_error(F_failure);
+ if (pthread_condattr_destroy(&array[i].array[j].attribute)) return F_status_set_error(F_attribute);
} // for
if (array[i].size && array[i].array) {
*
* This does not do parameter checking.
*
+ * When F_condition (with error bit) is returned, then pthread_condattr_destroy() is not called.
+ * When F_attribute or F_condition (with error bits) is returned, then f_memory_array_resize() is not called.
+ * On any error, the array is not guaranteed to be completely processed.
+ *
* @param start
* The inclusive start position in the array to start deleting.
* @param stop
* @return
* F_okay on success.
*
- * F_busy (with error bit) if a condition is busy.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_busy (with error bit) if a condition is busy when calling pthread_cond_destroy().
+ * F_parameter (with error bit) if a parameter is invalid (including parameter error when calling calling pthread_cond_destroy().
+ *
+ * F_attribute (with error bit) on error when calling pthread_condattr_destroy().
+ * F_condition (with error bit) on any error when calling pthread_cond_destroy().
*
* Errors (with error bit) from: f_memory_array_resize().
*
* @see f_memory_array_resize()
- * @see f_memory_arrays_resize()
*
* @see pthread_cond_destroy()
* @see pthread_condattr_destroy()
*
* This does not do parameter checking.
*
+ * When F_condition (with error bit) is returned, then pthread_condattr_destroy() is not called.
+ * When F_attribute or F_condition (with error bits) is returned, then f_memory_array_resize() is not called.
+ * On any error, the array is not guaranteed to be completely processed.
+ *
* @param start
* The inclusive start position in the array to start deleting.
* @param stop
* @return
* F_okay on success.
*
- * F_busy (with error bit) if a condition is busy.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_busy (with error bit) if a condition is busy when calling pthread_cond_destroy().
+ * F_parameter (with error bit) if a parameter is invalid (including parameter error when calling calling pthread_cond_destroy().
+ *
+ * F_attribute (with error bit) on error when calling pthread_condattr_destroy().
+ * F_condition (with error bit) on any error when calling pthread_cond_destroy().
*
* Errors (with error bit) from: f_memory_array_adjust().
*
* @see f_memory_array_adjust()
- * @see f_memory_arrays_adjust()
*
* @see pthread_cond_destroy()
* @see pthread_condattr_destroy()
if (error == EBUSY) return F_status_set_error(F_busy);
if (error == EINVAL) return F_status_set_error(F_parameter);
- return F_status_set_error(F_failure);
+ return F_status_set_error(F_read_write);
}
}
- return pthread_rwlockattr_destroy(&full->attribute) ? F_status_set_error(F_failure) : F_okay;
+ return pthread_rwlockattr_destroy(&full->attribute) ? F_status_set_error(F_attribute) : F_okay;
}
#endif // _di_f_thread_lock_full_delete_
* The pthread_rwlock_destroy() and pthread_rwlockattr_destroy() functions have no distinction like the *_destroy() and the *_delete() used by the FLL project.
* Therefore there is only this function for both deleting and destroying.
*
+ * When F_read_write (with error bit) is returned, then pthread_rwlockattr_destroy() is not called.
+ *
* @param full
* The full to delete.
*
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * F_failure (with error bit) on any other error.
+ * F_busy (with error bit) if a condition is busy when calling pthread_rwlock_destroy().
+ * F_parameter (with error bit) if a parameter is invalid (including parameter error when calling calling pthread_rwlock_destroy().
+ *
+ * F_attribute (with error bit) on error when calling pthread_rwlockattr_destroy().
+ * F_read_write (with error bit) on any error when calling pthread_rwlock_destroy().
*
+ * @see pthread_rwlock_destroy()
* @see pthread_rwlockattr_destroy()
*/
#ifndef _di_f_thread_lock_full_delete_
if (error == EBUSY) return F_status_set_error(F_busy);
if (error == EINVAL) return F_status_set_error(F_parameter);
- return F_status_set_error(F_failure);
+ return F_status_set_error(F_read_write);
}
- if (pthread_rwlockattr_destroy(&array[i].attribute)) return F_status_set_error(F_failure);
+ if (pthread_rwlockattr_destroy(&array[i].attribute)) return F_status_set_error(F_attribute);
} // for
return F_okay;
if (error == EBUSY) return F_status_set_error(F_busy);
if (error == EINVAL) return F_status_set_error(F_parameter);
- return F_status_set_error(F_failure);
+ return F_status_set_error(F_read_write);
}
- if (pthread_rwlockattr_destroy(&array[i].attribute)) return F_status_set_error(F_failure);
+ if (pthread_rwlockattr_destroy(&array[i].attribute)) return F_status_set_error(F_attribute);
} // for
return F_okay;
*
* This does not do parameter checking.
*
+ * When F_read_write (with error bit) is returned, then pthread_rwlockattr_destroy() is not called.
+ *
* @param start
* The inclusive start position in the array to start deleting.
* @param stop
* @return
* F_okay on success.
*
- * F_busy (with error bit) if a lock is busy.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_busy (with error bit) if a condition is busy when calling pthread_rwlock_destroy().
+ * F_parameter (with error bit) if a parameter is invalid (including parameter error when calling calling pthread_rwlock_destroy().
+ *
+ * F_attribute (with error bit) on error when calling pthread_rwlockattr_destroy().
+ * F_read_write (with error bit) on any error when calling pthread_rwlock_destroy().
*
* Errors (with error bit) from: f_memory_array_resize().
*
* @see f_memory_array_resize()
- * @see f_memory_arrays_resize()
*
* @see pthread_rwlock_destroy()
* @see pthread_rwlockattr_destroy()
*
* This does not do parameter checking.
*
+ * When F_read_write (with error bit) is returned, then pthread_rwlockattr_destroy() is not called.
+ *
* @param start
* The inclusive start position in the array to start deleting.
* @param stop
* @return
* F_okay on success.
*
- * F_busy (with error bit) if a lock is busy.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_busy (with error bit) if a condition is busy when calling pthread_rwlock_destroy().
+ * F_parameter (with error bit) if a parameter is invalid (including parameter error when calling calling pthread_rwlock_destroy().
+ *
+ * F_attribute (with error bit) on error when calling pthread_rwlockattr_destroy().
+ * F_read_write (with error bit) on any error when calling pthread_rwlock_destroy().
*
* Errors (with error bit) from: f_memory_array_adjust().
*
* @see f_memory_array_adjust()
- * @see f_memory_arrays_adjust()
*
* @see pthread_rwlock_destroy()
* @see pthread_rwlockattr_destroy()
if (error == EBUSY) return F_status_set_error(F_busy);
if (error == EINVAL) return F_status_set_error(F_parameter);
- return F_status_set_error(F_failure);
+ return F_status_set_error(F_read_write);
}
- if (pthread_rwlockattr_destroy(&array[i].array[j].attribute)) return F_status_set_error(F_failure);
+ if (pthread_rwlockattr_destroy(&array[i].array[j].attribute)) return F_status_set_error(F_attribute);
} // for
if (array[i].size && array[i].array) {
if (error == EBUSY) return F_status_set_error(F_busy);
if (error == EINVAL) return F_status_set_error(F_parameter);
- return F_status_set_error(F_failure);
+ return F_status_set_error(F_read_write);
}
- if (pthread_rwlockattr_destroy(&array[i].array[j].attribute)) return F_status_set_error(F_failure);
+ if (pthread_rwlockattr_destroy(&array[i].array[j].attribute)) return F_status_set_error(F_attribute);
} // for
if (array[i].size && array[i].array) {
*
* This does not do parameter checking.
*
+ * When F_read_write (with error bit) is returned, then pthread_rwlockattr_destroy() is not called.
+ *
* @param start
* The inclusive start position in the array to start deleting.
* @param stop
* @return
* F_okay on success.
*
- * F_busy (with error bit) if a lock is busy.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_busy (with error bit) if a condition is busy when calling pthread_rwlock_destroy().
+ * F_parameter (with error bit) if a parameter is invalid (including parameter error when calling calling pthread_rwlock_destroy().
+ *
+ * F_attribute (with error bit) on error when calling pthread_rwlockattr_destroy().
+ * F_read_write (with error bit) on any error when calling pthread_rwlock_destroy().
*
* Errors (with error bit) from: f_memory_array_resize().
*
* @see f_memory_array_resize()
- * @see f_memory_arrays_resize()
*
* @see pthread_rwlock_destroy()
* @see pthread_rwlockattr_destroy()
*
* This does not do parameter checking.
*
+ * When F_read_write (with error bit) is returned, then pthread_rwlockattr_destroy() is not called.
+ *
* @param start
* The inclusive start position in the array to start deleting.
* @param stop
* @return
* F_okay on success.
*
- * F_busy (with error bit) if a lock is busy.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_busy (with error bit) if a condition is busy when calling pthread_rwlock_destroy().
+ * F_parameter (with error bit) if a parameter is invalid (including parameter error when calling calling pthread_rwlock_destroy().
+ *
+ * F_attribute (with error bit) on error when calling pthread_rwlockattr_destroy().
+ * F_read_write (with error bit) on any error when calling pthread_rwlock_destroy().
*
* Errors (with error bit) from: f_memory_array_adjust().
*
* @see f_memory_array_adjust()
- * @see f_memory_arrays_adjust()
*
* @see pthread_rwlock_destroy()
* @see pthread_rwlockattr_destroy()
if (error == EBUSY) return F_status_set_error(F_busy);
if (error == EINVAL) return F_status_set_error(F_parameter);
- return F_status_set_error(F_failure);
+ return F_status_set_error(F_mutex);
}
}
- return pthread_mutexattr_destroy(&full->attribute) ? F_status_set_error(F_failure) : F_okay;
+ return pthread_mutexattr_destroy(&full->attribute) ? F_status_set_error(F_attribute) : F_okay;
}
#endif // _di_f_thread_mutex_full_delete_
* The pthread_mutex_destroy() and pthread_mutexattr_destroy() functions have no distinction like the *_destroy() and the *_delete() used by the FLL project.
* Therefore there is only this function for both deleting and destroying.
*
+ * When F_mutex (with error bit) is returned, then pthread_condattr_destroy() is not called.
+ *
* @param full
* The full to delete.
*
* @return
* F_okay on success.
*
- * F_busy (with error bit) if the mutex is busy.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_busy (with error bit) if a mutex is busy when calling pthread_mutex_destroy().
+ * F_parameter (with error bit) if a parameter is invalid (including parameter error when calling calling pthread_mutex_destroy().
*
- * F_failure (with error bit) on any other error.
+ * F_attribute (with error bit) on error when calling pthread_mutexattr_destroy().
+ * F_mutex (with error bit) on any error when calling pthread_mutex_destroy().
*
* @see pthread_mutex_destroy()
* @see pthread_mutexattr_destroy()
if (error == EBUSY) return F_status_set_error(F_busy);
if (error == EINVAL) return F_status_set_error(F_parameter);
- return F_status_set_error(F_failure);
+ return F_status_set_error(F_mutex);
}
- if (pthread_mutexattr_destroy(&array[i].attribute)) return F_status_set_error(F_failure);
+ if (pthread_mutexattr_destroy(&array[i].attribute)) return F_status_set_error(F_attribute);
} // for
return F_okay;
if (error == EBUSY) return F_status_set_error(F_busy);
if (error == EINVAL) return F_status_set_error(F_parameter);
- return F_status_set_error(F_failure);
+ return F_status_set_error(F_mutex);
}
- if (pthread_mutexattr_destroy(&array[i].attribute)) return F_status_set_error(F_failure);
+ if (pthread_mutexattr_destroy(&array[i].attribute)) return F_status_set_error(F_attribute);
} // for
return F_okay;
*
* This does not do parameter checking.
*
+ * When F_mutex (with error bit) is returned, then pthread_mutexattr_destroy() is not called.
+ * When F_attribute or F_mutex (with error bits) is returned, then f_memory_array_resize() is not called.
+ * On any error, the array is not guaranteed to be completely processed.
+ *
* @param start
* The inclusive start position in the array to start deleting.
* @param stop
* @return
* F_okay on success.
*
- * F_busy (with error bit) if a mutex is busy.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_busy (with error bit) if a mutex is busy when calling pthread_mutex_destroy().
+ * F_parameter (with error bit) if a parameter is invalid (including parameter error when calling calling pthread_mutex_destroy().
+ *
+ * F_attribute (with error bit) on error when calling pthread_mutexattr_destroy().
+ * F_mutex (with error bit) on any error when calling pthread_mutex_destroy().
*
* Errors (with error bit) from: f_memory_array_resize().
*
* @see f_memory_array_resize()
- * @see f_memory_arrays_resize()
*
* @see pthread_mutex_destroy()
* @see pthread_mutexattr_destroy()
*
* This does not do parameter checking.
*
+ * When F_mutex (with error bit) is returned, then pthread_mutexattr_destroy() is not called.
+ * When F_attribute or F_mutex (with error bits) is returned, then f_memory_array_resize() is not called.
+ * On any error, the array is not guaranteed to be completely processed.
+ *
* @param start
* The inclusive start position in the array to start deleting.
* @param stop
* @return
* F_okay on success.
*
- * F_busy (with error bit) if a mutex is busy.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_busy (with error bit) if a mutex is busy when calling pthread_mutex_destroy().
+ * F_parameter (with error bit) if a parameter is invalid (including parameter error when calling calling pthread_mutex_destroy().
+ *
+ * F_attribute (with error bit) on error when calling pthread_mutexattr_destroy().
+ * F_mutex (with error bit) on any error when calling pthread_mutex_destroy().
*
* Errors (with error bit) from: f_memory_array_adjust().
*
* @see f_memory_array_adjust()
- * @see f_memory_arrays_adjust()
*
* @see pthread_mutex_destroy()
* @see pthread_mutexattr_destroy()
if (error == EBUSY) return F_status_set_error(F_busy);
if (error == EINVAL) return F_status_set_error(F_parameter);
- return F_status_set_error(F_failure);
+ return F_status_set_error(F_mutex);
}
- if (pthread_mutexattr_destroy(&array[i].array[j].attribute)) return F_status_set_error(F_failure);
+ if (pthread_mutexattr_destroy(&array[i].array[j].attribute)) return F_status_set_error(F_attribute);
} // for
if (array[i].size && array[i].array) {
if (error == EBUSY) return F_status_set_error(F_busy);
if (error == EINVAL) return F_status_set_error(F_parameter);
- return F_status_set_error(F_failure);
+ return F_status_set_error(F_mutex);
}
- if (pthread_mutexattr_destroy(&array[i].array[j].attribute)) return F_status_set_error(F_failure);
+ if (pthread_mutexattr_destroy(&array[i].array[j].attribute)) return F_status_set_error(F_attribute);
} // for
if (array[i].size && array[i].array) {
*
* This does not do parameter checking.
*
+ * When F_mutex (with error bit) is returned, then pthread_mutexattr_destroy() is not called.
+ * When F_attribute or F_mutex (with error bits) is returned, then f_memory_array_resize() is not called.
+ * On any error, the array is not guaranteed to be completely processed.
+ *
* @param start
* The inclusive start position in the array to start deleting.
* @param stop
* @return
* F_okay on success.
*
- * F_busy (with error bit) if a mutex is busy.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_busy (with error bit) if a mutex is busy when calling pthread_mutex_destroy().
+ * F_parameter (with error bit) if a parameter is invalid (including parameter error when calling calling pthread_mutex_destroy().
+ *
+ * F_attribute (with error bit) on error when calling pthread_mutexattr_destroy().
+ * F_mutex (with error bit) on any error when calling pthread_mutex_destroy().
*
* Errors (with error bit) from: f_memory_array_resize().
*
* @see f_memory_array_resize()
- * @see f_memory_arrays_resize()
*
* @see pthread_mutex_destroy()
* @see pthread_mutexattr_destroy()
*
* This does not do parameter checking.
*
+ * When F_mutex (with error bit) is returned, then pthread_mutexattr_destroy() is not called.
+ * When F_attribute or F_mutex (with error bits) is returned, then f_memory_array_resize() is not called.
+ * On any error, the array is not guaranteed to be completely processed.
+ *
* @param start
* The inclusive start position in the array to start deleting.
* @param stop
* @return
* F_okay on success.
*
- * F_busy (with error bit) if a mutex is busy.
- * F_parameter (with error bit) if a parameter is invalid.
+ * F_busy (with error bit) if a mutex is busy when calling pthread_mutex_destroy().
+ * F_parameter (with error bit) if a parameter is invalid (including parameter error when calling calling pthread_mutex_destroy().
+ *
+ * F_attribute (with error bit) on error when calling pthread_mutexattr_destroy().
+ * F_mutex (with error bit) on any error when calling pthread_mutex_destroy().
*
* Errors (with error bit) from: f_memory_array_adjust().
*
* @see f_memory_array_adjust()
- * @see f_memory_arrays_adjust()
*
* @see pthread_mutex_destroy()
* @see pthread_mutexattr_destroy()
mock_errno_generic,
};
- f_status_t statuss[] = {
+ f_status_t statuss_1[] = {
F_busy,
F_parameter,
- F_failure,
+ F_barrier,
+ };
+
+ f_status_t statuss_2[] = {
+ F_busy,
+ F_parameter,
+ F_attribute,
};
for (uint8_t i = 0; i < 3; ++i) {
const f_status_t status = f_thread_barrier_full_delete(&full);
- assert_int_equal(status, F_status_set_error(statuss[i]));
+ assert_int_equal(status, F_status_set_error(statuss_1[i]));
} // for
{
const f_status_t status = f_thread_barrier_full_delete(&full);
- assert_int_equal(status, F_status_set_error(statuss[i]));
+ assert_int_equal(status, F_status_set_error(statuss_2[i]));
} // for
}
mock_errno_generic,
};
- f_status_t statuss[] = {
+ f_status_t statuss_1[] = {
F_busy,
F_parameter,
- F_failure,
+ F_barrier,
+ };
+
+ f_status_t statuss_2[] = {
+ F_busy,
+ F_parameter,
+ F_attribute,
};
for (uint8_t i = 0; i < 3; ++i) {
const f_status_t status = f_thread_barrier_fulls_delete_callback(0, 1, (void *) datass_array);
- assert_int_equal(status, F_status_set_error(statuss[i]));
+ assert_int_equal(status, F_status_set_error(statuss_1[i]));
} // for
{
const f_status_t status = f_thread_barrier_fulls_delete_callback(0, 1, (void *) datass_array);
- assert_int_equal(status, F_status_set_error(statuss[i]));
+ assert_int_equal(status, F_status_set_error(statuss_2[i]));
} // for
}
mock_errno_generic,
};
- f_status_t statuss[] = {
+ f_status_t statuss_1[] = {
F_busy,
F_parameter,
- F_failure,
+ F_barrier,
+ };
+
+ f_status_t statuss_2[] = {
+ F_busy,
+ F_parameter,
+ F_attribute,
};
for (uint8_t i = 0; i < 3; ++i) {
const f_status_t status = f_thread_barrier_fulls_destroy_callback(0, 1, (void *) datass_array);
- assert_int_equal(status, F_status_set_error(statuss[i]));
+ assert_int_equal(status, F_status_set_error(statuss_1[i]));
} // for
{
const f_status_t status = f_thread_barrier_fulls_destroy_callback(0, 1, (void *) datass_array);
- assert_int_equal(status, F_status_set_error(statuss[i]));
+ assert_int_equal(status, F_status_set_error(statuss_2[i]));
} // for
}
mock_errno_generic,
};
- f_status_t statuss[] = {
+ f_status_t statuss_1[] = {
F_busy,
F_parameter,
- F_failure,
+ F_barrier,
+ };
+
+ f_status_t statuss_2[] = {
+ F_busy,
+ F_parameter,
+ F_attribute,
};
for (uint8_t i = 0; i < 3; ++i) {
const f_status_t status = f_thread_barrier_fullss_delete_callback(0, 1, (void *) datass_array);
- assert_int_equal(status, F_status_set_error(statuss[i]));
+ assert_int_equal(status, F_status_set_error(statuss_1[i]));
} // for
{
const f_status_t status = f_thread_barrier_fullss_delete_callback(0, 1, (void *) datass_array);
- assert_int_equal(status, F_status_set_error(statuss[i]));
+ assert_int_equal(status, F_status_set_error(statuss_2[i]));
} // for
}
mock_errno_generic,
};
- f_status_t statuss[] = {
+ f_status_t statuss_1[] = {
F_busy,
F_parameter,
- F_failure,
+ F_barrier,
+ };
+
+ f_status_t statuss_2[] = {
+ F_busy,
+ F_parameter,
+ F_attribute,
};
for (uint8_t i = 0; i < 3; ++i) {
const f_status_t status = f_thread_barrier_fullss_destroy_callback(0, 1, (void *) datass_array);
- assert_int_equal(status, F_status_set_error(statuss[i]));
+ assert_int_equal(status, F_status_set_error(statuss_1[i]));
} // for
{
const f_status_t status = f_thread_barrier_fullss_destroy_callback(0, 1, (void *) datass_array);
- assert_int_equal(status, F_status_set_error(statuss[i]));
+ assert_int_equal(status, F_status_set_error(statuss_2[i]));
} // for
}
mock_errno_generic,
};
- f_status_t statuss[] = {
+ f_status_t statuss_1[] = {
F_busy,
F_parameter,
- F_failure,
+ F_condition,
+ };
+
+ f_status_t statuss_2[] = {
+ F_busy,
+ F_parameter,
+ F_attribute,
};
for (uint8_t i = 0; i < 3; ++i) {
const f_status_t status = f_thread_condition_full_delete(&full);
- assert_int_equal(status, F_status_set_error(statuss[i]));
+ assert_int_equal(status, F_status_set_error(statuss_1[i]));
} // for
{
const f_status_t status = f_thread_condition_full_delete(&full);
- assert_int_equal(status, F_status_set_error(statuss[i]));
+ assert_int_equal(status, F_status_set_error(statuss_2[i]));
} // for
}
mock_errno_generic,
};
- f_status_t statuss[] = {
- F_status_set_error(F_busy),
- F_status_set_error(F_parameter),
- F_status_set_error(F_failure),
+ f_status_t statuss_1[] = {
+ F_busy,
+ F_parameter,
+ F_condition,
+ };
+
+ f_status_t statuss_2[] = {
+ F_busy,
+ F_parameter,
+ F_attribute,
};
for (uint8_t i = 0; i < 3; ++i) {
const f_status_t status = f_thread_condition_fulls_delete_callback(0, 1, (void *) datass_array);
- assert_int_equal(status, statuss[i]);
+ assert_int_equal(status, F_status_set_error(statuss_1[i]));
} // for
{
const f_status_t status = f_thread_condition_fulls_delete_callback(0, 1, (void *) datass_array);
- assert_int_equal(status, statuss[i]);
+ assert_int_equal(status, F_status_set_error(statuss_2[i]));
} // for
}
mock_errno_generic,
};
- f_status_t statuss[] = {
- F_status_set_error(F_busy),
- F_status_set_error(F_parameter),
- F_status_set_error(F_failure),
+ f_status_t statuss_1[] = {
+ F_busy,
+ F_parameter,
+ F_condition,
+ };
+
+ f_status_t statuss_2[] = {
+ F_busy,
+ F_parameter,
+ F_attribute,
};
for (uint8_t i = 0; i < 3; ++i) {
const f_status_t status = f_thread_condition_fulls_destroy_callback(0, 1, (void *) datass_array);
- assert_int_equal(status, statuss[i]);
+ assert_int_equal(status, F_status_set_error(statuss_1[i]));
} // for
{
const f_status_t status = f_thread_condition_fulls_destroy_callback(0, 1, (void *) datass_array);
- assert_int_equal(status, statuss[i]);
+ assert_int_equal(status, F_status_set_error(statuss_2[i]));
} // for
}
mock_errno_generic,
};
- f_status_t statuss[] = {
- F_status_set_error(F_busy),
- F_status_set_error(F_parameter),
- F_status_set_error(F_failure),
+ f_status_t statuss_1[] = {
+ F_busy,
+ F_parameter,
+ F_condition,
+ };
+
+ f_status_t statuss_2[] = {
+ F_busy,
+ F_parameter,
+ F_attribute,
};
for (uint8_t i = 0; i < 3; ++i) {
const f_status_t status = f_thread_condition_fullss_delete_callback(0, 1, (void *) datass_array);
- assert_int_equal(status, statuss[i]);
+ assert_int_equal(status, F_status_set_error(statuss_1[i]));
} // for
{
const f_status_t status = f_thread_condition_fullss_delete_callback(0, 1, (void *) datass_array);
- assert_int_equal(status, statuss[i]);
+ assert_int_equal(status, F_status_set_error(statuss_2[i]));
} // for
}
mock_errno_generic,
};
- f_status_t statuss[] = {
- F_status_set_error(F_busy),
- F_status_set_error(F_parameter),
- F_status_set_error(F_failure),
+ f_status_t statuss_1[] = {
+ F_busy,
+ F_parameter,
+ F_condition,
+ };
+
+ f_status_t statuss_2[] = {
+ F_busy,
+ F_parameter,
+ F_attribute,
};
for (uint8_t i = 0; i < 3; ++i) {
const f_status_t status = f_thread_condition_fullss_destroy_callback(0, 1, (void *) datass_array);
- assert_int_equal(status, statuss[i]);
+ assert_int_equal(status, F_status_set_error(statuss_1[i]));
} // for
{
const f_status_t status = f_thread_condition_fullss_destroy_callback(0, 1, (void *) datass_array);
- assert_int_equal(status, statuss[i]);
+ assert_int_equal(status, F_status_set_error(statuss_2[i]));
} // for
}
mock_errno_generic,
};
- f_status_t statuss[] = {
+ f_status_t statuss_1[] = {
F_busy,
F_parameter,
- F_failure,
+ F_read_write,
+ };
+
+ f_status_t statuss_2[] = {
+ F_busy,
+ F_parameter,
+ F_attribute,
};
for (uint8_t i = 0; i < 3; ++i) {
const f_status_t status = f_thread_lock_full_delete(&full);
- assert_int_equal(status, F_status_set_error(statuss[i]));
+ assert_int_equal(status, F_status_set_error(statuss_1[i]));
} // for
{
const f_status_t status = f_thread_lock_full_delete(&full);
- assert_int_equal(status, F_status_set_error(statuss[i]));
+ assert_int_equal(status, F_status_set_error(statuss_2[i]));
} // for
}
mock_errno_generic,
};
- f_status_t statuss[] = {
- F_status_set_error(F_busy),
- F_status_set_error(F_parameter),
- F_status_set_error(F_failure),
+ f_status_t statuss_1[] = {
+ F_busy,
+ F_parameter,
+ F_read_write,
+ };
+
+ f_status_t statuss_2[] = {
+ F_busy,
+ F_parameter,
+ F_attribute,
};
for (uint8_t i = 0; i < 3; ++i) {
const f_status_t status = f_thread_lock_fulls_delete_callback(0, 1, (void *) datass_array);
- assert_int_equal(status, statuss[i]);
+ assert_int_equal(status, F_status_set_error(statuss_1[i]));
} // for
{
const f_status_t status = f_thread_lock_fulls_delete_callback(0, 1, (void *) datass_array);
- assert_int_equal(status, statuss[i]);
+ assert_int_equal(status, F_status_set_error(statuss_2[i]));
}
}
mock_errno_generic,
};
- f_status_t statuss[] = {
- F_status_set_error(F_busy),
- F_status_set_error(F_parameter),
- F_status_set_error(F_failure),
+ f_status_t statuss_1[] = {
+ F_busy,
+ F_parameter,
+ F_read_write,
+ };
+
+ f_status_t statuss_2[] = {
+ F_busy,
+ F_parameter,
+ F_attribute,
};
for (uint8_t i = 0; i < 3; ++i) {
const f_status_t status = f_thread_lock_fulls_destroy_callback(0, 1, (void *) datass_array);
- assert_int_equal(status, statuss[i]);
+ assert_int_equal(status, F_status_set_error(statuss_1[i]));
} // for
{
const f_status_t status = f_thread_lock_fulls_destroy_callback(0, 1, (void *) datass_array);
- assert_int_equal(status, statuss[i]);
+ assert_int_equal(status, F_status_set_error(statuss_2[i]));
}
}
mock_errno_generic,
};
- f_status_t statuss[] = {
- F_status_set_error(F_busy),
- F_status_set_error(F_parameter),
- F_status_set_error(F_failure),
+ f_status_t statuss_1[] = {
+ F_busy,
+ F_parameter,
+ F_read_write,
+ };
+
+ f_status_t statuss_2[] = {
+ F_busy,
+ F_parameter,
+ F_attribute,
};
for (uint8_t i = 0; i < 3; ++i) {
const f_status_t status = f_thread_lock_fullss_delete_callback(0, 1, (void *) datass_array);
- assert_int_equal(status, statuss[i]);
+ assert_int_equal(status, F_status_set_error(statuss_1[i]));
} // for
{
const f_status_t status = f_thread_lock_fullss_delete_callback(0, 1, (void *) datass_array);
- assert_int_equal(status, statuss[i]);
+ assert_int_equal(status, F_status_set_error(statuss_2[i]));
}
}
mock_errno_generic,
};
- f_status_t statuss[] = {
- F_status_set_error(F_busy),
- F_status_set_error(F_parameter),
- F_status_set_error(F_failure),
+ f_status_t statuss_1[] = {
+ F_busy,
+ F_parameter,
+ F_read_write,
+ };
+
+ f_status_t statuss_2[] = {
+ F_busy,
+ F_parameter,
+ F_attribute,
};
for (uint8_t i = 0; i < 3; ++i) {
const f_status_t status = f_thread_lock_fullss_destroy_callback(0, 1, (void *) datass_array);
- assert_int_equal(status, statuss[i]);
+ assert_int_equal(status, F_status_set_error(statuss_1[i]));
} // for
{
const f_status_t status = f_thread_lock_fullss_destroy_callback(0, 1, (void *) datass_array);
- assert_int_equal(status, statuss[i]);
+ assert_int_equal(status, F_status_set_error(statuss_2[i]));
}
}
mock_errno_generic,
};
- f_status_t statuss[] = {
+ f_status_t statuss_1[] = {
F_busy,
F_parameter,
- F_failure,
+ F_mutex,
+ };
+
+ f_status_t statuss_2[] = {
+ F_busy,
+ F_parameter,
+ F_attribute,
};
for (uint8_t i = 0; i < 3; ++i) {
const f_status_t status = f_thread_mutex_full_delete(&full);
- assert_int_equal(status, F_status_set_error(statuss[i]));
+ assert_int_equal(status, F_status_set_error(statuss_1[i]));
} // for
{
const f_status_t status = f_thread_mutex_full_delete(&full);
- assert_int_equal(status, F_status_set_error(statuss[i]));
+ assert_int_equal(status, F_status_set_error(statuss_2[i]));
}
}
mock_errno_generic,
};
- f_status_t statuss[] = {
- F_status_set_error(F_busy),
- F_status_set_error(F_parameter),
- F_status_set_error(F_failure),
+ f_status_t statuss_1[] = {
+ F_busy,
+ F_parameter,
+ F_mutex,
+ };
+
+ f_status_t statuss_2[] = {
+ F_busy,
+ F_parameter,
+ F_attribute,
};
for (uint8_t i = 0; i < 3; ++i) {
const f_status_t status = f_thread_mutex_fulls_delete_callback(0, 1, (void *) datass_array);
- assert_int_equal(status, statuss[i]);
+ assert_int_equal(status, F_status_set_error(statuss_1[i]));
} // for
{
const f_status_t status = f_thread_mutex_fulls_delete_callback(0, 1, (void *) datass_array);
- assert_int_equal(status, statuss[i]);
+ assert_int_equal(status, F_status_set_error(statuss_2[i]));
}
}
mock_errno_generic,
};
- f_status_t statuss[] = {
- F_status_set_error(F_busy),
- F_status_set_error(F_parameter),
- F_status_set_error(F_failure),
+ f_status_t statuss_1[] = {
+ F_busy,
+ F_parameter,
+ F_mutex,
+ };
+
+ f_status_t statuss_2[] = {
+ F_busy,
+ F_parameter,
+ F_attribute,
};
for (uint8_t i = 0; i < 3; ++i) {
const f_status_t status = f_thread_mutex_fulls_destroy_callback(0, 1, (void *) datass_array);
- assert_int_equal(status, statuss[i]);
+ assert_int_equal(status, F_status_set_error(statuss_1[i]));
} // for
{
const f_status_t status = f_thread_mutex_fulls_destroy_callback(0, 1, (void *) datass_array);
- assert_int_equal(status, statuss[i]);
+ assert_int_equal(status, F_status_set_error(statuss_2[i]));
}
}
mock_errno_generic,
};
- f_status_t statuss[] = {
- F_status_set_error(F_busy),
- F_status_set_error(F_parameter),
- F_status_set_error(F_failure),
+ f_status_t statuss_1[] = {
+ F_busy,
+ F_parameter,
+ F_mutex,
+ };
+
+ f_status_t statuss_2[] = {
+ F_busy,
+ F_parameter,
+ F_attribute,
};
for (uint8_t i = 0; i < 3; ++i) {
const f_status_t status = f_thread_mutex_fullss_delete_callback(0, 1, (void *) datass_array);
- assert_int_equal(status, statuss[i]);
+ assert_int_equal(status, F_status_set_error(statuss_1[i]));
} // for
{
const f_status_t status = f_thread_mutex_fullss_delete_callback(0, 1, (void *) datass_array);
- assert_int_equal(status, statuss[i]);
+ assert_int_equal(status, F_status_set_error(statuss_2[i]));
}
}
mock_errno_generic,
};
- f_status_t statuss[] = {
- F_status_set_error(F_busy),
- F_status_set_error(F_parameter),
- F_status_set_error(F_failure),
+ f_status_t statuss_1[] = {
+ F_busy,
+ F_parameter,
+ F_mutex,
+ };
+
+ f_status_t statuss_2[] = {
+ F_busy,
+ F_parameter,
+ F_attribute,
};
for (uint8_t i = 0; i < 3; ++i) {
const f_status_t status = f_thread_mutex_fullss_destroy_callback(0, 1, (void *) datass_array);
- assert_int_equal(status, statuss[i]);
+ assert_int_equal(status, F_status_set_error(statuss_1[i]));
} // for
{
const f_status_t status = f_thread_mutex_fullss_destroy_callback(0, 1, (void *) datass_array);
- assert_int_equal(status, statuss[i]);
+ assert_int_equal(status, F_status_set_error(statuss_2[i]));
}
}