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

Use "BSP" lock to protect UtAssert globals #1061

Closed
jphickey opened this issue May 28, 2021 · 0 comments · Fixed by #1065 or #1076
Closed

Use "BSP" lock to protect UtAssert globals #1061

jphickey opened this issue May 28, 2021 · 0 comments · Fixed by #1065 or #1076
Assignees
Milestone

Comments

@jphickey
Copy link
Contributor

Is your feature request related to a problem? Please describe.
As originally noted in #955, the UtAssert global data structures are not protected against concurrent modification by multiple test threads.

UtAssert* functions should not be invoked from child threads, but many tests do this anyway. Although no observed failures can be traced directly to this, it is not correct.

Describe the solution you'd like
The BSP lock that was originally implemented to clean up console output can also serve to protect these data structures. This lock can make it so UtAssert calls can be safely done from any test thread.

Describe alternatives you've considered
The tests which use child tasks could be redesigned to only assert from the main thread, but this can be difficult to do in some cases.

Additional context
This is the second half of the request in #955, split into a separate work item. Adding a mutex around the modifications is lower risk than changing the internal data structure initialization, and they can be implemented separately.

Requester Info
Joseph Hickey, Vantage Systems, Inc.

jphickey added a commit to jphickey/osal that referenced this issue Jun 1, 2021
Adding a mutex around modifications to globals allows
UtAssert statements to be done from any test thread.
@jphickey jphickey self-assigned this Jun 1, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 1, 2021
Adding a mutex around modifications to globals allows
UtAssert statements to be done from any test thread.
astrogeco added a commit that referenced this issue Jun 10, 2021
Fix #1061, add mutex lock around UtAssert globals
@skliper skliper added this to the 6.0.0 milestone Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants