]> Kevux Git Server - fll/commitdiff
Progress: controller program and related.
authorKevin Day <thekevinday@gmail.com>
Sat, 20 Mar 2021 00:36:28 +0000 (19:36 -0500)
committerKevin Day <thekevinday@gmail.com>
Sat, 20 Mar 2021 00:41:57 +0000 (19:41 -0500)
Use "copy" instead of "clone", it seems more accurate given that the code is not guaranteeing the same exact memory structure (only the data is guaranteed).
I believe that I need to document my "completeness principle", documenting the structures and what needs to be done.
I also need to document the exception cases.

Implementing the rule copy function, I realized that I need to have the copy function and not just utilize the "append" functions.
There are many functions where "append" does not make sense.
This means that "copy" must be part of the completeness.

Comment out the cache clearing code.
I will probably get to that part last.

level_0/f_capability/c/capability.c
level_0/f_capability/c/capability.h
level_0/f_control_group/c/control_group.c
level_0/f_control_group/c/control_group.h
level_0/f_limit/c/limit.c
level_0/f_limit/c/limit.h
level_3/controller/c/private-controller.c
level_3/controller/c/private-entry.c
level_3/controller/c/private-rule.c
level_3/controller/c/private-rule.h
level_3/controller/c/private-thread.c

index 271637eaa5456c318fa8036e75a156b91031d8ce..a8c32ec3d3c32767b19edb861e6e563ee50f4630 100644 (file)
@@ -52,15 +52,15 @@ extern "C" {
     }
   #endif // _di_f_capability_clear_flag_
 
-  #ifndef _di_f_capability_clone_
-    f_status_t f_capability_clone(const f_capability_t source, f_capability_t *destination) {
+  #ifndef _di_f_capability_copy_
+    f_status_t f_capability_copy(const f_capability_t source, f_capability_t *destination) {
       #ifndef _di_level_0_parameter_checking_
         if (!destination) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
 
       return F_status_set_error(F_implemented_not);
     }
-  #endif // _di_f_capability_clone_
+  #endif // _di_f_capability_copy_
 
   #ifndef _di_f_capability_compare_
     f_status_t f_capability_compare(const f_capability_t capability1, const f_capability_t capability2, int *flags) {
@@ -477,8 +477,8 @@ extern "C" {
     }
   #endif // _di_f_capability_clear_flag_
 
-  #ifndef _di_f_capability_clone_
-    f_status_t f_capability_clone(const f_capability_t source, f_capability_t *destination) {
+  #ifndef _di_f_capability_copy_
+    f_status_t f_capability_copy(const f_capability_t source, f_capability_t *destination) {
       #ifndef _di_level_0_parameter_checking_
         if (!destination) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -494,7 +494,7 @@ extern "C" {
 
       return F_status_set_error(F_failure);
     }
-  #endif // _di_f_capability_clone_
+  #endif // _di_f_capability_copy_
 
   #ifndef _di_f_capability_compare_
     f_status_t f_capability_compare(const f_capability_t capability1, const f_capability_t capability2, int *flags) {
index dbf10ff6fa17f81f4890158cb4bbc7e371c3f38a..2c4ed7588b182332d6ee677eaa75dbaadaea9561 100644 (file)
@@ -158,10 +158,10 @@ extern "C" {
 #endif // _di_f_capability_clear_flag_
 
 /**
- * Clone (copy) the capability structure.
+ * Copy the capability structure.
  *
  * @param source
- *   The capability to clone.
+ *   The capability to copy from.
  * @param destination
  *   The capability to copy to.
  *   This must be freed via f_capability_delete() when finished with.
@@ -177,9 +177,9 @@ extern "C" {
  *
  * @see cap_dup()
  */
-#ifndef _di_f_capability_clone_
-  extern f_status_t f_capability_clone(const f_capability_t source, f_capability_t *destination);
-#endif // _di_f_capability_clone_
+#ifndef _di_f_capability_copy_
+  extern f_status_t f_capability_copy(const f_capability_t source, f_capability_t *destination);
+#endif // _di_f_capability_copy_
 
 /**
  * Compare two capability structures.
index 8139d7f85e79778bd3516e04b9b43a5f19d33018..d3cc52976ce5c79d077bc387f328e15ca8dc5dc2 100644 (file)
@@ -4,6 +4,32 @@
 extern "C" {
 #endif
 
+#ifndef _di_f_control_group_copy_
+  f_status_t f_control_group_copy(const f_control_group_t source, f_control_group_t *destination) {
+    #ifndef _di_level_0_parameter_checking_
+      if (!destination) return F_status_set_error(F_parameter);
+    #endif // _di_level_0_parameter_checking_
+
+    destination->as_new = source.as_new;
+    destination->path.used = 0;
+    destination->groups.used = 0;
+
+    f_status_t status = F_none;
+
+    if (source.path.used) {
+      status = f_string_dynamic_append(source.path, &destination->path);
+      if (F_status_is_error(status)) return status;
+    }
+
+    if (source.groups.used) {
+      status = f_string_dynamics_append(source.groups, &destination->groups);
+      if (F_status_is_error(status)) return status;
+    }
+
+    return F_none;
+  }
+#endif // _di_f_control_group_copy_
+
 #ifdef __cplusplus
 } // extern "C"
 #endif
index f0b8e62923e192d15366d9204621e61dde5c5d7f..ed3c4919b6fa55333d44cbd83b368171f7634f54 100644 (file)
 extern "C" {
 #endif
 
+/**
+ * Copy the source control group onto the destination control group.
+ *
+ * @param source
+ *   The source to append.
+ * @param destination
+ *   The destination the source is appended onto.
+ *
+ * @return
+ *   F_none on success.
+ *
+ *   F_parameter (with error bit) if a parameter is invalid.
+ *
+ *   Errors (with error bit) from: f_string_dynamic_append().
+ *   Errors (with error bit) from: f_string_dynamics_append().
+ *
+ * @see f_string_dynamic_append()
+ * @see f_string_dynamics_append()
+ */
+#ifndef _di_f_control_group_copy_
+  extern f_status_t f_control_group_copy(const f_control_group_t source, f_control_group_t *destination);
+#endif // _di_f_control_group_copy_
+
 #ifdef __cplusplus
 } // extern "C"
 #endif
index e048fc0b4e2021ec5ac3588a1b5ec5998a9b7f66..e4e0494f2f3825ff922397f408ed40758da92a46 100644 (file)
@@ -23,6 +23,54 @@ extern "C" {
   }
 #endif // _di_f_limit_process_
 
+#ifndef _di_f_limit_sets_copy_
+  f_status_t f_limit_sets_copy(const f_limit_sets_t source, f_limit_sets_t *destination) {
+    #ifndef _di_level_0_parameter_checking_
+      if (!destination) return F_status_set_error(F_parameter);
+    #endif // _di_level_0_parameter_checking_
+
+    destination->used = 0;
+
+    if (source.used > destination->size) {
+      f_status_t status = F_none;
+
+      f_macro_memory_structure_resize(status, (*destination), f_limit_set_t, source.used)
+      if (F_status_is_error(status)) return status;
+    }
+
+    for (f_array_length_t i = 0; i < source.used; ++i) {
+      destination->array[i].type = source.array[i].type;
+      destination->array[i].value = source.array[i].value;
+    } // for
+
+    return F_none;
+  }
+#endif // _di_f_limit_sets_copy_
+
+#ifndef _di_f_limit_values_copy_
+  f_status_t f_limit_values_copy(const f_limit_values_t source, f_limit_values_t *destination) {
+    #ifndef _di_level_0_parameter_checking_
+      if (!destination) return F_status_set_error(F_parameter);
+    #endif // _di_level_0_parameter_checking_
+
+    destination->used = 0;
+
+    if (source.used > destination->size) {
+      f_status_t status = F_none;
+
+      f_macro_memory_structure_resize(status, (*destination), f_limit_value_t, source.used)
+      if (F_status_is_error(status)) return status;
+    }
+
+    for (f_array_length_t i = 0; i < source.used; ++i) {
+      destination->array[i].rlim_cur = source.array[i].rlim_cur;
+      destination->array[i].rlim_max = source.array[i].rlim_max;
+    } // for
+
+    return F_none;
+  }
+#endif // _di_f_limit_values_copy_
+
 #ifdef __cplusplus
 } // extern "C"
 #endif
index ff4253e70b2b2c468c43e1fcf26915695b975071..13c4f5fd5d36b6e9d8868e99dcd757bcecaccadc 100644 (file)
@@ -59,6 +59,48 @@ extern "C" {
   extern f_status_t f_limit_process(const pid_t id, const int type, const f_limit_value_t *value_next, f_limit_value_t *value_current);
 #endif // _di_f_limit_process_
 
+/**
+ * Copy the source limit sets onto the destination limit sets.
+ *
+ * @param source
+ *   The source to append.
+ * @param destination
+ *   The destination the source is appended onto.
+ *
+ * @return
+ *   F_none on success.
+ *
+ *   F_parameter (with error bit) if a parameter is invalid.
+ *
+ *   Errors (with error bit) from: f_memory_structure_increase_by().
+ *
+ * @see f_memory_structure_increase_by()
+ */
+#ifndef _di_f_limit_sets_copy_
+  extern f_status_t f_limit_sets_copy(const f_limit_sets_t source, f_limit_sets_t *destination);
+#endif // _di_f_limit_sets_copy_
+
+/**
+ * Copy the source limit values onto the destination limit values.
+ *
+ * @param source
+ *   The source to append.
+ * @param destination
+ *   The destination the source is appended onto.
+ *
+ * @return
+ *   F_none on success.
+ *
+ *   F_parameter (with error bit) if a parameter is invalid.
+ *
+ *   Errors (with error bit) from: f_memory_structure_increase_by().
+ *
+ * @see f_memory_structure_increase_by()
+ */
+#ifndef _di_f_limit_values_copy_
+  extern f_status_t f_limit_values_copy(const f_limit_values_t source, f_limit_values_t *destination);
+#endif // _di_f_limit_values_copy_
+
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 2fe90a915878ee606198651dfb664c6edd3121a7..d188ced2b5a976ac4d46f93c764b40b2815d14db 100644 (file)
@@ -1353,8 +1353,6 @@ extern "C" {
   }
 #endif // _di_controller_validate_has_graph_
 
-controller_processs_t
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 77eb662b8d8afc92662fad7f40221c4efdb6f42c..d2f52477e64d13080566333a38daaa6a06458ea6 100644 (file)
@@ -206,7 +206,7 @@ extern "C" {
           fprintf(thread_data.data->warning.to.stream, "%s", thread_data.data->warning.notable.after->string);
           fprintf(thread_data.data->warning.to.stream, "%s'.%s%c", thread_data.data->warning.context.before->string, thread_data.data->warning.context.after->string, f_string_eol_s[0]);
 
-          controller_entry_error_print(thread_data.data->warning, cache->action);
+          controller_entry_error_print_cache(thread_data.data->warning, cache->action);
         }
 
         continue;
@@ -659,24 +659,24 @@ extern "C" {
         status = fll_fss_basic_list_read(cache->buffer_file, &range, &cache->object_items, &cache->content_items, &cache->delimits, 0, &cache->comments);
 
         if (F_status_is_error(status)) {
-          controller_error_print(thread_data.data->error, F_status_set_fine(status), "fll_fss_basic_list_read", F_true, thread_data);
+          controller_error_print(thread_data.data->error, F_status_set_fine(status), "fll_fss_basic_list_read", F_true, thread_data.thread);
         }
         else {
           status = fl_fss_apply_delimit(cache->delimits, &cache->buffer_file);
 
           if (F_status_is_error(status)) {
-            controller_error_print(thread_data.data->error, F_status_set_fine(status), "fl_fss_apply_delimit", F_true, thread_data);
+            controller_error_print(thread_data.data->error, F_status_set_fine(status), "fl_fss_apply_delimit", F_true, thread_data.thread);
           }
         }
       }
       else {
         if (thread_data.data->error.verbosity != f_console_verbosity_quiet) {
-          f_thread_lock(&thread_data.thread->lock.print);
+          f_thread_mutex_lock(&thread_data.thread->lock.print);
 
           fprintf(thread_data.data->error.to.stream, "%c", f_string_eol_s[0]);
           fprintf(thread_data.data->error.to.stream, "%s%sThe entry file is empty.%s%c", thread_data.data->error.context.before->string, thread_data.data->error.prefix ? thread_data.data->error.prefix : f_string_empty_s, thread_data.data->error.context.after->string, f_string_eol_s[0]);
 
-          f_thread_unlock(&thread_data.thread->lock.print);
+          f_thread_mutex_unlock(&thread_data.thread->lock.print);
         }
 
         status = F_status_set_error(F_data_not);
@@ -756,7 +756,7 @@ extern "C" {
 
             if (fl_string_dynamic_compare(thread_data.setting->entry.items.array[j].name, cache->action.name_item) == F_equal_to) {
               if (thread_data.data->warning.verbosity == f_console_verbosity_debug) {
-                f_thread_lock(&thread_data.thread->lock.print);
+                f_thread_mutex_lock(&thread_data.thread->lock.print);
 
                 fprintf(thread_data.data->warning.to.stream, "%c", f_string_eol_s[0]);
                 fprintf(thread_data.data->warning.to.stream, "%s%sIgnoring duplicate entry item '", thread_data.data->warning.context.before->string, thread_data.data->warning.prefix ? thread_data.data->warning.prefix : f_string_empty_s);
@@ -765,7 +765,7 @@ extern "C" {
 
                 controller_entry_error_print_cache(thread_data.data->warning, cache->action);
 
-                f_thread_unlock(&thread_data.thread->lock.print);
+                f_thread_mutex_unlock(&thread_data.thread->lock.print);
               }
 
               code |= 0x2;
@@ -803,18 +803,18 @@ extern "C" {
           status = controller_string_dynamic_append_terminated(cache->action.name_item, &thread_data.setting->entry.items.array[at].name);
 
           if (F_status_is_error(status)) {
-            controller_error_print(thread_data.data->error, F_status_set_fine(status), "controller_string_dynamic_append_terminated", F_true, thread_data);
+            controller_error_print(thread_data.data->error, F_status_set_fine(status), "controller_string_dynamic_append_terminated", F_true, thread_data.thread);
             break;
           }
 
           status = controller_entry_actions_read(*range, thread_data, cache, &thread_data.setting->entry.items.array[at].actions);
 
           if (F_status_is_error(status)) {
-            f_thread_lock(&thread_data.thread->lock.print);
+            f_thread_mutex_lock(&thread_data.thread->lock.print);
 
             controller_entry_error_print_cache(thread_data.data->error, cache->action);
 
-            f_thread_unlock(&thread_data.thread->lock.print);
+            f_thread_mutex_unlock(&thread_data.thread->lock.print);
 
             if (F_status_set_fine(status) == F_memory_not) {
               break;
@@ -828,14 +828,14 @@ extern "C" {
 
           if (!(code & 0x1)) {
             if (thread_data.data->error.verbosity != f_console_verbosity_quiet) {
-              f_thread_lock(&thread_data.thread->lock.print);
+              f_thread_mutex_lock(&thread_data.thread->lock.print);
 
               fprintf(thread_data.data->error.to.stream, "%c", f_string_eol_s[0]);
               fprintf(thread_data.data->error.to.stream, "%s%sThe required entry item '", thread_data.data->error.context.before->string, thread_data.data->error.prefix ? thread_data.data->error.prefix : f_string_empty_s);
               fprintf(thread_data.data->error.to.stream, "%s%s%s%s", thread_data.data->error.context.after->string, thread_data.data->error.notable.before->string, controller_string_main_s, thread_data.data->error.notable.after->string);
               fprintf(thread_data.data->error.to.stream, "%s' was not found.%s%c", thread_data.data->error.context.before->string, thread_data.data->error.context.after->string, f_string_eol_s[0]);
 
-              f_thread_unlock(&thread_data.thread->lock.print);
+              f_thread_mutex_unlock(&thread_data.thread->lock.print);
             }
 
             status = F_status_set_error(F_found_not);
@@ -885,12 +885,12 @@ extern "C" {
                     status = controller_string_dynamic_append_terminated(thread_data.setting->entry.items.array[i].name, &cache->action.name_item);
 
                     if (F_status_is_error(status)) {
-                      controller_error_print(thread_data.data->error, F_status_set_fine(status), "controller_string_dynamic_append_terminated", F_true, thread_data);
+                      controller_error_print(thread_data.data->error, F_status_set_fine(status), "controller_string_dynamic_append_terminated", F_true, thread_data.thread);
                       break;
                     }
 
                     if (thread_data.data->error.verbosity != f_console_verbosity_quiet) {
-                      f_thread_lock(&thread_data.thread->lock.print);
+                      f_thread_mutex_lock(&thread_data.thread->lock.print);
 
                       fprintf(thread_data.data->error.to.stream, "%c", f_string_eol_s[0]);
                       fprintf(thread_data.data->error.to.stream, "%s%sThe required entry item '", thread_data.data->error.context.before->string, thread_data.data->error.prefix ? thread_data.data->error.prefix : f_string_empty_s);
@@ -899,7 +899,7 @@ extern "C" {
 
                       controller_entry_error_print_cache(thread_data.data->error, cache->action);
 
-                      f_thread_unlock(&thread_data.thread->lock.print);
+                      f_thread_mutex_unlock(&thread_data.thread->lock.print);
                     }
 
                     action->number = 0;
@@ -929,7 +929,7 @@ extern "C" {
     }
 
     if (F_status_is_error(status)) {
-      controller_entry_error_print(thread_data.data->error, cache->action);
+      controller_entry_error_print_cache(thread_data.data->error, cache->action);
 
       thread_data.setting->entry.status = controller_status_simplify(F_status_set_fine(status));
     }
index 8eb18ebdb91a3a1e1aca57248c05339797c31d50..3dfdc0f195436a05456a1a3684acd64431b2e785 100644 (file)
@@ -411,10 +411,10 @@ extern "C" {
     destination->user = source.user;
     destination->group = source.group;
 
-    destination->timestamp.seconds = source.seconds;
-    destination->timestamp.nanoseconds = source.nanoseconds;
+    destination->timestamp.seconds = source.timestamp.seconds;
+    destination->timestamp.nanoseconds = source.timestamp.nanoseconds;
 
-    destination->path_control.used = 0;
+    destination->id.used = 0;
     destination->name.used = 0;
     destination->path.used = 0;
     destination->script.used = 0;
@@ -428,88 +428,131 @@ extern "C" {
     destination->wish.used = 0;
 
     destination->affinity.used = 0;
-    destination->capability.used = 0;
-    destination->control_group.used = 0;
     destination->groups.used = 0;
     destination->limits.used = 0;
-    destination->scheduler.used = 0;
+    destination->scheduler.policy = source.scheduler.policy;
+    destination->scheduler.priority = source.scheduler.priority;
 
     destination->items.used = 0;
 
     if (source.id.used) {
-
-      status = f_string_dynamic_append(source.id, &dynamic->id);
+      status = f_string_dynamic_append(source.id, &destination->id);
       if (F_status_is_error(status)) return status;
     }
 
     if (source.name.used) {
-
-      status = f_string_dynamic_append(source.name, &dynamic->name);
+      status = f_string_dynamic_append(source.name, &destination->name);
       if (F_status_is_error(status)) return status;
     }
 
     if (source.path.used) {
-
-      status = f_string_dynamic_append(source.path, &dynamic->path);
+      status = f_string_dynamic_append(source.path, &destination->path);
       if (F_status_is_error(status)) return status;
     }
 
     if (source.script.used) {
-
-      status = f_string_dynamic_append(source.script, &dynamic->script);
+      status = f_string_dynamic_append(source.script, &destination->script);
       if (F_status_is_error(status)) return status;
     }
 
     if (source.define.used) {
       status = f_string_maps_append(source.define, &destination->define);
+      if (F_status_is_error(status)) return status;
     }
 
     if (source.parameter.used) {
       status = f_string_maps_append(source.parameter, &destination->parameter);
+      if (F_status_is_error(status)) return status;
     }
 
     if (source.environment.used) {
       status = f_string_dynamics_append(source.environment, &destination->environment);
+      if (F_status_is_error(status)) return status;
     }
 
     if (source.need.used) {
       status = f_string_dynamics_append(source.need, &destination->need);
+      if (F_status_is_error(status)) return status;
     }
 
     if (source.want.used) {
       status = f_string_dynamics_append(source.want, &destination->want);
+      if (F_status_is_error(status)) return status;
     }
 
     if (source.wish.used) {
       status = f_string_dynamics_append(source.wish, &destination->wish);
+      if (F_status_is_error(status)) return status;
     }
 
     if (source.affinity.used) {
-      status = f_int32s_append(source.affinity, &destination->affinity);
+      status = f_type_int32s_append(source.affinity, &destination->affinity);
+      if (F_status_is_error(status)) return status;
     }
 
-    if (source.capability.used) {
-      // @todo copy capability
-    }
+    status = f_capability_copy(source.capability, &destination->capability);
+    if (F_status_is_error(status)) return status;
 
-    if (source.control_group.used) {
-      // @todo copy control_group
-    }
+    status = f_control_group_copy(source.control_group, &destination->control_group);
+    if (F_status_is_error(status)) return status;
 
     if (source.groups.used) {
-      status = f_int32s_append(source.groups, &destination->groups);
+      status = f_type_int32s_append(source.groups, &destination->groups);
+      if (F_status_is_error(status)) return status;
     }
 
     if (source.limits.used) {
-      status = f_limit_sets_append(source.limits, &destination->limits);
-    }
-
-    if (source.scheduler.used) {
-      // @todo copy scheduler
+      status = f_limit_sets_copy(source.limits, &destination->limits);
+      if (F_status_is_error(status)) return status;
     }
 
     if (source.items.used) {
-      // @todo copy items
+      controller_rule_item_t *item_source = 0;
+      controller_rule_item_t *item_destination = 0;
+
+      controller_rule_action_t *action_source = 0;
+      controller_rule_action_t *action_destination = 0;
+
+      if (source.items.used > destination->items.size) {
+        status = controller_rule_items_increase_by(source.items.used - destination->items.size, &destination->items);
+        if (F_status_is_error(status)) return status;
+      }
+
+      f_array_length_t i = 0;
+      f_array_length_t j = 0;
+
+      for (; i < source.items.used; ++i) {
+
+        item_source = &source.items.array[i];
+        item_destination = &destination->items.array[i];
+
+        if (item_source->actions.used > item_destination->actions.size) {
+          status = controller_rule_actions_increase_by(item_source->actions.used - item_destination->actions.size, &item_destination->actions);
+          if (F_status_is_error(status)) return status;
+        }
+
+        item_destination->type = item_source->type;
+        item_destination->line = item_source->line;
+
+        for (j = 0; j < item_source->actions.used; ++j) {
+
+          action_source = &item_source->actions.array[j];
+          action_destination = &item_destination->actions.array[j];
+
+          action_destination->type = action_source->type;
+          action_destination->line = action_source->line;
+          action_destination->status = action_source->status;
+
+          action_destination->parameters.used = 0;
+
+          status = f_string_dynamics_append(action_source->parameters, &action_destination->parameters);
+          if (F_status_is_error(status)) return status;
+        } // for
+
+        item_destination->actions.used = item_source->actions.used;
+      } // for
+
+      destination->items.used = source.items.used;
     }
 
     return status;
@@ -678,7 +721,7 @@ extern "C" {
         status = fll_control_group_prepare(rule->control_group);
 
         if (F_status_is_error(status)) {
-          controller_error_print_locked(thread_data.data->error, F_status_set_fine(status), "fll_control_group_prepare", F_true, thread_data.thread);
+          controller_error_print(thread_data.data->error, F_status_set_fine(status), "fll_control_group_prepare", F_true, thread_data.thread);
 
           rule->status = F_status_set_error(F_failure);
           return status;
@@ -719,7 +762,7 @@ extern "C" {
     status = fl_environment_load_names(rule->environment, &environment);
 
     if (F_status_is_error(status)) {
-      controller_error_print_locked(thread_data.data->error, F_status_set_fine(status), "fl_environment_load_names", F_true, thread_data.thread);
+      controller_error_print(thread_data.data->error, F_status_set_fine(status), "fl_environment_load_names", F_true, thread_data.thread);
 
       rule->status = F_status_set_error(F_failure);
       return status;
@@ -1906,7 +1949,7 @@ extern "C" {
         // @fixme the cache should probably store a rule type and then that can used instead of calling controller_rule_copy() here.
         controller_rule_t rule = controller_rule_t_initialize;
 
-        status = controller_rule_copy(&thread_data.setting->rules.array[index], &rule);
+        status = controller_rule_copy(thread_data.setting->rules.array[index], &rule);
 
         if (F_status_is_error_not(status)) {
           status = controller_rule_execute(action, options, thread_data, &cache, &rule);
index 12852ee1f7e6c44244aaed1b744989ab52cce94d..be56f00d4260c8eefcdc5d8296046854359aed17 100644 (file)
@@ -144,10 +144,24 @@ extern "C" {
  * @return
  *   F_none on success.
  *
- *   Errors (with error bit) from: XXXX().
+ *   Errors (with error bit) from: f_capability_copy().
+ *   Errors (with error bit) from: f_control_group_copy().
+ *   Errors (with error bit) from: f_limit_sets_copy().
+ *   Errors (with error bit) from: f_string_dynamic_append().
+ *   Errors (with error bit) from: f_string_dynamics_append().
+ *   Errors (with error bit) from: f_string_maps_append().
+ *   Errors (with error bit) from: f_type_int32s_append().
+ *
+ *  @see f_capability_copy()
+ *  @see f_control_group_copy()
+ *  @see f_limit_sets_append()
+ *  @see f_string_dynamic_append()
+ *  @see f_string_dynamics_append()
+ *  @see f_string_maps_append()
+ *  @see f_type_int32s_append()
  */
 #ifndef _di_controller_rule_copy_
-  extern f_status_t controller_rule_copy(controller_rule_t *source, controller_rule_t *destination) f_gcc_attribute_visibility_internal;
+  extern f_status_t controller_rule_copy(const controller_rule_t source, controller_rule_t *destination) f_gcc_attribute_visibility_internal;
 #endif // _di_controller_rule_copy_
 
 /**
index b6bb1599cc3e5459d39db2dbaa1ba3abb8093379..53eefb6f7d7ea2a1cdb3236b009e147f42ca4fe6 100644 (file)
@@ -75,7 +75,7 @@ extern "C" {
 
     thread->asynchronouss.used = 0;
 
-    f_thread_mutex_unlock(&thread->lock.asynchronous);
+    f_thread_unlock(&thread->lock.asynchronous);
   }
 #endif // _di_controller_thread_asynchronous_cancel_
 
@@ -91,7 +91,8 @@ extern "C" {
     for (; thread_data->thread->enabled; ) {
       sleep(interval);
 
-      if (f_thread_mutex_lock_try(&thread_data->thread->lock.asynchronous) == F_none) {
+      /*
+      if (f_thread_lock_write_try(&thread_data->thread->lock.asynchronous) == F_none) {
         controller_thread_t *thread = &thread_data->thread;
 
         if (thread->asynchronouss.used) {
@@ -100,9 +101,9 @@ extern "C" {
             if (!thread->enabled) break;
             if (!thread->asynchronouss.array[i].state) continue;
 
-            if (f_thread_mutex_lock_try(&thread->asynchronouss.array[i].lock) != F_none) continue;
+            if (f_thread_lock_write_try(&thread->asynchronouss.array[i].lock) != F_none) continue;
 
-            if (f_thread_mutex_lock_try(&thread_data->setting->rules.array[thread->asynchronouss.array[i].index].lock) == F_none) {
+            if (f_thread_lock_write_try(&thread_data->setting->rules.array[thread->asynchronouss.array[i].index].lock) == F_none) {
 
               if (thread->asynchronouss.array[i].state == controller_asynchronous_state_done) {
                 f_thread_join(thread->asynchronouss.array[i].id, 0);
@@ -134,11 +135,11 @@ extern "C" {
               thread->asynchronouss.array[i].state = 0;
             }
             else if (thread->asynchronouss.array[i].state) {
-              f_thread_mutex_unlock(&thread->asynchronouss.array[i].lock);
+              f_thread_unlock(&thread->asynchronouss.array[i].lock);
               break;
             }
 
-            f_thread_mutex_unlock(&thread->asynchronouss.array[i].lock);
+            f_thread_unlock(&thread->asynchronouss.array[i].lock);
           } // for
         }
 
@@ -146,8 +147,9 @@ extern "C" {
           controller_asynchronouss_resize(thread->asynchronouss.used, &thread->asynchronouss);
         }
 
-        f_thread_mutex_unlock(&thread->lock.asynchronous);
+        f_thread_unlock(&thread->lock.asynchronous);
       }
+      */
     } // for
 
     return 0;
@@ -281,7 +283,7 @@ extern "C" {
 
         if (F_status_is_error(status)) {
           if (data->error.verbosity != f_console_verbosity_quiet) {
-            controller_error_print_locked(data->error, F_status_set_fine(status), "f_thread_create", F_true, &thread);
+            controller_error_print(data->error, F_status_set_fine(status), "f_thread_create", F_true, &thread);
           }
         }
       }