-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
Added SchemaProxy
mutex #163
#172
Conversation
Rendering causes bits to be set on structs in the model. Concurrency causes race issues with reading a writing of these bits, as there is no locking in the model. Until now. locking prevents concurrent renders that use a shared model from conflicting with one another. Addresses #163 and pb33f/libopenapi-validator#23 Signed-off-by: quobix <dave@quobix.com>
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #172 +/- ##
=======================================
Coverage 99.80% 99.80%
=======================================
Files 148 148
Lines 10639 10643 +4
=======================================
+ Hits 10618 10622 +4
Misses 21 21
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
why is the mutex a pointer? |
My general rule is to ask myself "why should this NOT be a pointer". I generally 99% lean on pointer. This is just a case of me defaulting on my coding behavior. If I pass around anything, I move it to a pointer, because I don't want to copy anything. |
should a pointer to a mutex be copied? |
I don't know, I haven't seen any literature saying that it's any different from a struct. https://go.dev/src/sync/mutex.go The receiver on |
I am not sure on that one either, just having seen warnings pop up in the terminal when a struct with a mutex was copied. |
I've not seen any warnings pop up and the behavior is as I expect, tests pass accordingly. If any strangeness appears with this functionality, then I'll drop it back to a struct :) |
Rendering causes bits to be set on structs in the model. Concurrency causes race issues with reading a writing of these bits, as there is no locking in the model.
Until now. locking prevents concurrent renders that use a shared model from conflicting with one another.
Addresses #163 and pb33f/libopenapi-validator#23