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

Is there someting wrong with sync_cv_broadcast_release in condition_var.h #47

Open
lydmcu opened this issue Nov 24, 2021 · 0 comments
Open

Comments

@lydmcu
Copy link

lydmcu commented Nov 24, 2021

hi
In sync_cv_broadcast_release it will call sync_bin_sem_post before seL4_Signal.
But In sync_cv_wait, sync_bin_sem_wait(lock) is called after seL4_Wait,
when call sync_bin_sem_post in sync_cv_broadcast_release, it will make "lock->value == 2", it will make sync_bin_sem_bare_post trigger assert " assert(*value <= 1)"

static inline int sync_bin_sem_bare_post(seL4_CPtr notification, volatile int *value) { /* We can do an "unsafe" increment here because we know we are the only * lock holder. */ int val = sync_atomic_increment(value, __ATOMIC_RELEASE); assert(*value <= 1); // if (val <= 0) { seL4_Signal(notification); } return 0; }
I do not this function can work for performance reasons

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

No branches or pull requests

1 participant