-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Clean up confusion with deprecated constructors and callbacks in thread-spawning functions #2549
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
geky
changed the title
Clean up issues with deprecated constructors and callbacks in thread-spawning functions
Clean up confusion with deprecated constructors and callbacks in thread-spawning functions
Aug 25, 2016
Additionally, the following changes were don to avoid combinatorial explosion in function overloads as a result of adding cv-qualifiers: - Added convenience function for inferred type - Deprecated callback overloads qhere cv-qualifiers are not scalable Supported overloads: callback(void (*f)(A...)); callback(const Callback<R(A...)> &); callback(T *t, void (*f)(T*, A...)); callback(const T *t, void (*f)(const T*, A...)); callback(volatile T *t, void (*f)(volatile T*, A...)); callback(const volatile T *t, void (*f)(const volatile T*, A...)); callback(T *t, void (T::*f)(A...)); callback(const T *t, void (T::*f)(A...) const); callback(volatile T *t, void (T::*f)(A...) volatile); callback(const volatile T *t, void (T::*f)(A...) const volatile);
- Marked `call` and `operator()` functions as const - Moved to static_cast for internal function pointer to avoid losing compiler checked const-safety - Added test for `operator=` with non-callback types - Moved from zero-cast to value-initializer when callback is null - Added `operator==` and `operator!=` - Removed special handling of null callback - Replicated doxygen to all overloads - Added correct nops where uninitialized callbacks are called - Added assertion for null callback - Removed copy-constructor from callback constructor
As the templated tests grew, the resulting binary exceeded a flash size of 64K. This caused the test to incorrectly fail on small devices. Moved and split into the following: TESTS/mbed_functional/callback TESTS/mbed_functional/callback_small TESTS/mbed_functional/callback_big TESTS/mbed_functional/functionpointer
One limitation of C++ is that implicit casts do not occur when matching template overloads, as a consequence the callback's argument type requires a strict match. Unfortunately, the prevents the previously common pattern of using void pointers as function arguments, causing unnecessary problems for users porting code. Thing *t; void doit(void *p) { blablabla } Callback<void()> cb(t, doit); To avoid this, explicit overloads on void pointers were added. This avoids a template expansion, and allows the implicit cast to occur as the user would expect.
User feedback indicated that the previous deprecation notices were confusing and mislead migration from the old style of thread spawning. The deprecation notices were updated to emphasize the replacement functions, and examples of correct usage were added in the doxygen.
geky
force-pushed
the
thread-clarification
branch
from
August 26, 2016 17:51
a321fb5
to
022f821
Compare
/morph test |
@mbed-bot: TEST HOST_OSES=ALL |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
Outputmbed Build Number: 790 All builds and test passed! |
[Build 879] |
sg-
added
release-version: 5.1.4
and removed
ready for merge
release-version: 5.1.4
labels
Sep 9, 2016
artokin
pushed a commit
to artokin/mbed-os
that referenced
this pull request
Jan 22, 2021
…..91f3ff6 91f3ff6 Merge branch 'release_internal' into release_external 3999b6e Iotthd 4495 (ARMmbed#2556) 90c3263 RPL Prefix handling update: f761409 Close Nanostack v12.8.0 ChangeLog (ARMmbed#2549) git-subtree-dir: features/nanostack/sal-stack-nanostack git-subtree-split: 91f3ff6
artokin
pushed a commit
to artokin/mbed-os
that referenced
this pull request
Apr 20, 2021
…..0903b81 0903b81 Merge remote-tracking branch 'origin/release_internal' into release_external 51429c9 FHSS WS: api function to set TX allowance level (ARMmbed#2612) 01b1188 Fix Child NUD with long ARO registrations 20b49ce Optimize out of memory handler to remove more memory in EF mode f1b03bc FHSS WS: Allow transmitting unicast frames on broadcast channel for 1st hop node in EF mode (ARMmbed#2609) 2f5e5e2 Generic forwarding callback and EF state enabler for Wi-SUN BBR. 007dfa2 Allow transmitting on RX slot for 1st hop device in expedited forwarding mode (ARMmbed#2607) 6524872 Implemented FHSS expedited forwarding mode (ARMmbed#2606) 91e0b4c QoS traffic class documentation update. 3acd3a4 Fix warnings found by cppcheck (ARMmbed#2605) d2f5347 MPX and MAC API update 7310cc0 MAC: "CCA fail on RX" event for TX done callback (ARMmbed#2602) cd109c3 Clear Ack tx and tx process in MAC reset (ARMmbed#2601) 45504fd Optimize stagger based on uptime and startup type ed5209e Iotthd 4584 (ARMmbed#2599) 60726dc Fixed blacklisting overflow (ARMmbed#2597) 23334b7 Added support for High Priority forward state 3ec2a2c Corrected freed memory access on incoming EAPOL handling aecadc4 Fixed delayed interrupt (ARMmbed#2596) 1fca2c1 CCA backoffs max to 9 (ARMmbed#2595) f3d2fa1 Added API function to get neighbor table information from Wi-SUN 3bb089b Validate randomized fixed channel (ARMmbed#2592) 70743a1 MAC stabilisation fixes (ARMmbed#2591) e936a26 Reduce periodic DNS traces a45fe3f Improved CSMA-CA logic for Wi-SUN (ARMmbed#2585) 56b7735 improved Wi-SUN stack statistics added e656190 Wi-SUN neighbour allocate update 799f837 Added address check for Whiteboard address ADD 0b6caa3 Wi-SUN network timing parameter tuning 4921465 Supress warnings f5cecd7 Enable external connection for routers e129a0a Added LLC EAPOL temporary neighbor remove when authentication completes (ARMmbed#2583) fa20fb9 Added calculation of LLC and LLC EAPOL message queue average (ARMmbed#2582) 7f7c01a Added retry traces to authenticator EAP-TLS, 4WH, and GKH a87646d On startup deletes NVM GTKs if EUI-64 has been changed (ARMmbed#2576) 509a6f9 Add CI commands to PR template (ARMmbed#2579) eb6a4f7 Change stagger calculation to give more bandwidth to application 82f1d54 Wi-SUN bpptstrap clear destination cache at discovery phase. 71b0588 Destination cache update: f92c385 Enabled PMTU timeout to destination cache after used. 957b358 DHCP server and Agent relay update 25b9124 Merge remote-tracking branch 'origin/release_internal' into release_external c825b04 Corrected covery warning on delay_us multiplication be63bbb Updated changelog 77a76c7 Corrected nw size set on automatic mode 65e6c2d Updated unit tests 16e3402 Added waiting queue to EAPOL authentications to Border Router b9c0b7d Wi-SUN border router starts faster in static configuration 2f427e1 Local repair start and stop clear advertised_dodag_membership_since_last_repair when state is updated. 0a01ab1 RPL dio send update dd39963 Wi-SUN Border router uses Static address as DODAGID 7a3c833 Additional check to detect parent connection problem ffe48c9 WS management: domain configuration functions implemented (ARMmbed#2567) 5e9ac4e Added new Callback to RPL indicate Multicast DIS received from RPL Parent 85b949e Bootstrap and EAPOL treats all MAC TX failure causes similarly b57d9bc Add support for anonymous addressing in Wi-SUN border router (ARMmbed#2565) 7400c8b CFG: API for PHY mode id and channel plan id get & validate (ARMmbed#2564) 2832fe8 Added Socket reference limitter 890aad1 Wi-SUN MTU size update and IPv6 minium MTU routing skip 3ad28c1 Added throttling of number of simultaneous EAPOL authentications 0b84299 Source route handler call Wi-Sun border router alive function. c8343b1 Added support for dynamic RPL default lifetime d258068 Iotthd 4478 (ARMmbed#2560) 7ca6c24 Enable and modify memory limits for packet receiving e2b028d Close CHANGELOG.md for v12.8.1 (ARMmbed#2557) 91f3ff6 Merge branch 'release_internal' into release_external 3999b6e Iotthd 4495 (ARMmbed#2556) 90c3263 RPL Prefix handling update: f761409 Close Nanostack v12.8.0 ChangeLog (ARMmbed#2549) f8ae0e9 Merge remote-tracking branch 'origin/release_internal' into release_external 3275f83 Added support for handle RPL hop by Hop sender rank 0. d62c589 Activated RPL force tunnel for wi-sun. 3e1064a RPL tunnel force functionality update 3207e5c RPL parent select timer random update from 1.0-1.2 to 1.0-1.5. bc09cba MAC Ack wait fixed for OFDM (ARMmbed#2552) 5106b1d Fixed unused variable and function warnings. 4096c1a Wi-SUN bootstrap support RPL poison from Connected state to Discovery 66378d1 RPL Poison update git-subtree-dir: features/nanostack/sal-stack-nanostack git-subtree-split: 0903b81
artokin
pushed a commit
to artokin/mbed-os
that referenced
this pull request
Apr 21, 2021
…183d87..0903b81 0903b81 Merge remote-tracking branch 'origin/release_internal' into release_external 51429c9 FHSS WS: api function to set TX allowance level (ARMmbed#2612) 01b1188 Fix Child NUD with long ARO registrations 20b49ce Optimize out of memory handler to remove more memory in EF mode f1b03bc FHSS WS: Allow transmitting unicast frames on broadcast channel for 1st hop node in EF mode (ARMmbed#2609) 2f5e5e2 Generic forwarding callback and EF state enabler for Wi-SUN BBR. 007dfa2 Allow transmitting on RX slot for 1st hop device in expedited forwarding mode (ARMmbed#2607) 6524872 Implemented FHSS expedited forwarding mode (ARMmbed#2606) 91e0b4c QoS traffic class documentation update. 3acd3a4 Fix warnings found by cppcheck (ARMmbed#2605) d2f5347 MPX and MAC API update 7310cc0 MAC: "CCA fail on RX" event for TX done callback (ARMmbed#2602) cd109c3 Clear Ack tx and tx process in MAC reset (ARMmbed#2601) 45504fd Optimize stagger based on uptime and startup type ed5209e Iotthd 4584 (ARMmbed#2599) 60726dc Fixed blacklisting overflow (ARMmbed#2597) 23334b7 Added support for High Priority forward state 3ec2a2c Corrected freed memory access on incoming EAPOL handling aecadc4 Fixed delayed interrupt (ARMmbed#2596) 1fca2c1 CCA backoffs max to 9 (ARMmbed#2595) f3d2fa1 Added API function to get neighbor table information from Wi-SUN 3bb089b Validate randomized fixed channel (ARMmbed#2592) 70743a1 MAC stabilisation fixes (ARMmbed#2591) e936a26 Reduce periodic DNS traces a45fe3f Improved CSMA-CA logic for Wi-SUN (ARMmbed#2585) 56b7735 improved Wi-SUN stack statistics added e656190 Wi-SUN neighbour allocate update 799f837 Added address check for Whiteboard address ADD 0b6caa3 Wi-SUN network timing parameter tuning 4921465 Supress warnings f5cecd7 Enable external connection for routers e129a0a Added LLC EAPOL temporary neighbor remove when authentication completes (ARMmbed#2583) fa20fb9 Added calculation of LLC and LLC EAPOL message queue average (ARMmbed#2582) 7f7c01a Added retry traces to authenticator EAP-TLS, 4WH, and GKH a87646d On startup deletes NVM GTKs if EUI-64 has been changed (ARMmbed#2576) 509a6f9 Add CI commands to PR template (ARMmbed#2579) eb6a4f7 Change stagger calculation to give more bandwidth to application 82f1d54 Wi-SUN bpptstrap clear destination cache at discovery phase. 71b0588 Destination cache update: f92c385 Enabled PMTU timeout to destination cache after used. 957b358 DHCP server and Agent relay update 25b9124 Merge remote-tracking branch 'origin/release_internal' into release_external c825b04 Corrected covery warning on delay_us multiplication be63bbb Updated changelog 77a76c7 Corrected nw size set on automatic mode 65e6c2d Updated unit tests 16e3402 Added waiting queue to EAPOL authentications to Border Router b9c0b7d Wi-SUN border router starts faster in static configuration 2f427e1 Local repair start and stop clear advertised_dodag_membership_since_last_repair when state is updated. 0a01ab1 RPL dio send update dd39963 Wi-SUN Border router uses Static address as DODAGID 7a3c833 Additional check to detect parent connection problem ffe48c9 WS management: domain configuration functions implemented (ARMmbed#2567) 5e9ac4e Added new Callback to RPL indicate Multicast DIS received from RPL Parent 85b949e Bootstrap and EAPOL treats all MAC TX failure causes similarly b57d9bc Add support for anonymous addressing in Wi-SUN border router (ARMmbed#2565) 7400c8b CFG: API for PHY mode id and channel plan id get & validate (ARMmbed#2564) 2832fe8 Added Socket reference limitter 890aad1 Wi-SUN MTU size update and IPv6 minium MTU routing skip 3ad28c1 Added throttling of number of simultaneous EAPOL authentications 0b84299 Source route handler call Wi-Sun border router alive function. c8343b1 Added support for dynamic RPL default lifetime d258068 Iotthd 4478 (ARMmbed#2560) 7ca6c24 Enable and modify memory limits for packet receiving e2b028d Close CHANGELOG.md for v12.8.1 (ARMmbed#2557) 91f3ff6 Merge branch 'release_internal' into release_external 3999b6e Iotthd 4495 (ARMmbed#2556) 90c3263 RPL Prefix handling update: f761409 Close Nanostack v12.8.0 ChangeLog (ARMmbed#2549) f8ae0e9 Merge remote-tracking branch 'origin/release_internal' into release_external 3275f83 Added support for handle RPL hop by Hop sender rank 0. d62c589 Activated RPL force tunnel for wi-sun. 3e1064a RPL tunnel force functionality update 3207e5c RPL parent select timer random update from 1.0-1.2 to 1.0-1.5. bc09cba MAC Ack wait fixed for OFDM (ARMmbed#2552) 5106b1d Fixed unused variable and function warnings. 4096c1a Wi-SUN bootstrap support RPL poison from Connected state to Discovery 66378d1 RPL Poison update git-subtree-dir: connectivity/nanostack/sal-stack-nanostack git-subtree-split: 0903b81
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note: This is currently dependent on #2496 and will be updated based on the discussion in that pr. Here are the new commits:
756a090 Added explicit void specialization in callbacks
022f821 Rewrote thread deprecation notices to help migration
User feedback indicated that the previous deprecation notices were confusing. Additionally, limitations on implicit casts for callback arguments tripped up attempts at migrating from the old style of thread spawning and led to a poor user experience.
In an effort to remedy this:
cc @0xc0170, @pan-, @maclobdell