-
Notifications
You must be signed in to change notification settings - Fork 3k
Remove Semaphore deprecated APIs #12609
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
Conversation
@@ -201,8 +201,8 @@ void test_no_wait(void) | |||
Semaphore sem(0, 1); | |||
T timeout; | |||
timeout.attach_callback(mbed::callback(sem_callback, &sem), 0ULL); | |||
int32_t sem_slots = sem.wait(0); | |||
TEST_ASSERT_EQUAL(1, sem_slots); | |||
bool sem_sts = sem.try_acquire_for(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bool sem_sts = sem.try_acquire_for(0); | |
bool sem_acquired = sem.try_acquire_for(0); | |
TEST_ASSERT_EQUAL(true, sem_acquired); |
I suggest using a more meaningful variable name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idiomatically, it's better to use try_acquire()
rather than try_acquire_for(0)
.
Doesn't matter much if mixing it with timed stuff, but in principle, try_acquire()
gives you scope to omit timing code from bare metal builds, whereas the _for
form forcibly includes it.
4646c05
to
06cfc1a
Compare
CI started |
Test run: FAILEDSummary: 3 of 4 test jobs failed Failed test jobs:
|
|
@rajkan01 I remember seeing this commit somewhere else, in another PR, where was it? Did we receive any response there from teams? |
06cfc1a
to
a6b78c6
Compare
Pull request has been modified.
The other PR is #12572 (comment) |
Commit updated with cherry-pick #12609 |
@tymoteuszblochmobica As discussed, please raise a separate PR as Your changes are not dependent on this PR. |
CI restarted while awaiting review approvals |
Test run: SUCCESSSummary: 6 of 6 test jobs passed |
The job passed, the failures are not related to this test job (misconfig in CI). |
I'll fix the statuses and merge this one |
@rajkan01 Where is this one being tracked? I was just notified that ublox won't build on master today. |
cc @ARMmbed/team-ublox @MarceloSalazar |
@0xc0170 our PR almost ready we would try tomorrow just some out of box testing remaing |
Summary of changes
Removed Semaphore deprecated APIs.
Impact of changes
Breaking change: Semaphore
wait
andwait_until
methods have been deprecated since Mbed OS 5.13 and are removed now.Migration actions required
Use Semaphore
acquire
,try_acquire
,try_acquire_for
andtry_acquire_until
methods.Documentation
None
Pull request type
Test results
Reviewers
@evedon