-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The call restrictions of ten_env APIs need to be clarified #139
Comments
Some APIs in bool ten_extension_on_configure_done(ten_env_t *self) {
TEN_ASSERT(self, "Invalid argument.");
TEN_ASSERT(ten_env_check_integrity(self, true), "Invalid use of ten_env %p.",
self);
ten_extension_t *extension = ten_env_get_attached_extension(self);
TEN_ASSERT(extension, "Invalid argument.");
TEN_ASSERT(ten_extension_check_integrity(extension, true),
"Invalid use of extension %p.", extension);
TEN_LOGD("[%s] on_configure() done.",
ten_extension_get_name(extension, true));
if (extension->state != TEN_EXTENSION_STATE_INIT) { // <== timing check
TEN_LOGI("[%s] Failed to on_configure_done() because of incorrect timing.",
ten_extension_get_name(extension, true));
return false;
}
} By leveraging this approach, it is possible to extend similar checks to other APIs in |
1 similar comment
Some APIs in bool ten_extension_on_configure_done(ten_env_t *self) {
TEN_ASSERT(self, "Invalid argument.");
TEN_ASSERT(ten_env_check_integrity(self, true), "Invalid use of ten_env %p.",
self);
ten_extension_t *extension = ten_env_get_attached_extension(self);
TEN_ASSERT(extension, "Invalid argument.");
TEN_ASSERT(ten_extension_check_integrity(extension, true),
"Invalid use of extension %p.", extension);
TEN_LOGD("[%s] on_configure() done.",
ten_extension_get_name(extension, true));
if (extension->state != TEN_EXTENSION_STATE_INIT) { // <== timing check
TEN_LOGI("[%s] Failed to on_configure_done() because of incorrect timing.",
ten_extension_get_name(extension, true));
return false;
}
} By leveraging this approach, it is possible to extend similar checks to other APIs in |
The ten_env APIs are not safe to be called in any context or in any thread, so we need to clarify these call restrictions and the exceptions or error messages under incorrect calls.
The text was updated successfully, but these errors were encountered: