This "initializing" flag is now useless. It was used to make sure that
only the implementation side of a component could set the component's
private user data. This is now enforced by typing (component vs. private
component), and it is always okay to set a private component's user
data.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
/* User-defined data */
void *user_data;
/* User-defined data */
void *user_data;
- /*
- * Used to protect operations which may only be used during
- * a component's initialization.
- */
- bt_bool initializing;
-
/* Input and output ports (weak references) */
GPtrArray *input_ports;
GPtrArray *output_ports;
/* Input and output ports (weak references) */
GPtrArray *input_ports;
GPtrArray *output_ports;
- component->initializing = BT_TRUE;
-
if (component_class->methods.init) {
BT_LOGD_STR("Calling user's initialization method.");
ret = component_class->methods.init(
if (component_class->methods.init) {
BT_LOGD_STR("Calling user's initialization method.");
ret = component_class->methods.init(
init_method_data);
BT_LOGD("User method returned: status=%s",
bt_component_status_string(ret));
init_method_data);
BT_LOGD("User method returned: status=%s",
bt_component_status_string(ret));
- component->initializing = BT_FALSE;
if (ret != BT_COMPONENT_STATUS_OK) {
BT_LOGW_STR("Initialization method failed.");
BT_PUT(component);
if (ret != BT_COMPONENT_STATUS_OK) {
BT_LOGW_STR("Initialization method failed.");
BT_PUT(component);
- component->initializing = BT_FALSE;
ret = component_validation_funcs[type](component);
if (ret != BT_COMPONENT_STATUS_OK) {
BT_LOGW("Component is invalid: status=%s",
ret = component_validation_funcs[type](component);
if (ret != BT_COMPONENT_STATUS_OK) {
BT_LOGW("Component is invalid: status=%s",
- if (!component->initializing) {
- ret = BT_COMPONENT_STATUS_INVALID;
- goto end;
- }
-
component->user_data = data;
BT_LOGV("Set component's user data: "
"comp-addr=%p, comp-name=\"%s\", user-data-addr=%p",
component->user_data = data;
BT_LOGV("Set component's user data: "
"comp-addr=%p, comp-name=\"%s\", user-data-addr=%p",