From: Kevin Day Date: Tue, 19 Jan 2021 03:24:07 +0000 (-0600) Subject: Update: f_thread_create() fixes. X-Git-Tag: 0.5.3~117 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=2e606ceeb244068daf0a1c6e577716ccfd482a43;p=fll Update: f_thread_create() fixes. The f_thread_create() function should allow for attribute and argument to be optional. The pthread_create() allows for attribute to be NULL and I am now also assuming that the passed arguments can also be NULL. --- diff --git a/level_0/f_thread/c/thread.c b/level_0/f_thread/c/thread.c index 105c98c..eac1436 100644 --- a/level_0/f_thread/c/thread.c +++ b/level_0/f_thread/c/thread.c @@ -555,10 +555,8 @@ extern "C" { #ifndef _di_f_thread_create_ f_status_t f_thread_create(const f_thread_attribute_t *attribute, f_thread_id_t *id, void *(*routine) (void *), void *argument) { #ifndef _di_level_0_parameter_checking_ - if (!attribute) return F_status_set_error(F_parameter); if (!id) return F_status_set_error(F_parameter); if (!routine) return F_status_set_error(F_parameter); - if (!argument) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ const int error = pthread_create(id, attribute, routine, argument); diff --git a/level_0/f_thread/c/thread.h b/level_0/f_thread/c/thread.h index f278c27..03b7d52 100644 --- a/level_0/f_thread/c/thread.h +++ b/level_0/f_thread/c/thread.h @@ -650,14 +650,16 @@ extern "C" { * Get the user account by the user id. * * @param attribute - * The thread attributes. + * (optional) The thread attributes. + * Set to NULL to use default attributes. * @param id * The thread ID. * This gets populated with the created thread ID (aka: the "child" thread). * @param routine * The function to execute. * @param argument - * The structure containing all arguments to pass to the routine. + * (optional) The structure containing all arguments to pass to the routine. + * Set to NULL to not pass an argument. * * @return * F_none on success.