online-bridge-hackathon / DDS

An api that returns DDS results for a given deal or partial deal
https://bit.ly/bridge-hackathon
Apache License 2.0
4 stars 7 forks source link

Fix data race when setting maximum thread number #49

Closed suokko closed 4 years ago

suokko commented 4 years ago

Calls to SetMaxThreads or SetResources aren't thread safe. This requires caller to provide synchronization with any other libdds call. To avoid synchronization requirement I decided to move SetMaxThreads call to initialization.

Signed-off-by: Pauli suokkos@gmail.com


I agree this deserves separation from configuration changes. The one line change make much bigger impact than my predicted while writing it. This also means my original comment was outdated today to make sure people will know in future why DDS object is created as a global.