Skip to content
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

Feature Request: aco_get_co() return NULL when the caller is main co #48

Open
PunchShadow opened this issue Aug 13, 2021 · 4 comments
Open
Assignees
Labels

Comments

@PunchShadow
Copy link

I'm wonder how to determine main co and non-main co while executing the same function.
As the document said, aco_get_co() should be called by non-main co.
How about returning NULL pointer to reveal the caller is main co ??

@hnes
Copy link
Owner

hnes commented Aug 15, 2021

Thanks for your proposal, but I'm afraid I may not have enough spare time to do this recently.

I would like to give you a workaround:

func check_is_in_main_co
	this_co = aco_get_co()
	if this_co == main_co || this_co == NULL 
		return true
	else
		return false

@hnes
Copy link
Owner

hnes commented Aug 15, 2021

In addition, for the sake of compatibility, I think adding a new API is a better choice.

@hnes hnes self-assigned this Aug 15, 2021
@hnes hnes added the Proposal label Aug 15, 2021
@PunchShadow
Copy link
Author

Thanks for your acception. Maybe I could issue a PR later.

@PunchShadow
Copy link
Author

Please review PR #49. Thanks !!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants