lhr-solar / BPS

Battery Protection System Code
MIT License
4 stars 2 forks source link

added pthread mutex to prevent race condition in non thread safe writ… #564

Closed tasniabari closed 1 year ago

tasniabari commented 1 year ago

…e within Simulator_Log

Quality Assurance Checklist

To make reviews more efficient, please make sure the software feature meets the following standards and check everything off that meets the quality check. Once everything has been checked, the assigned reviewers will begin the review process. Edit this description to check off the list.

There are exceptions with all guidelines. As long as your decisions are justified, then you are good! Contact the reviewers or the leads about any exceptions.

Requirements

Things to Consider

manthanand commented 1 year ago

minor change make pthread_mutex_t SimulatorLog_Sem; static if its only used in this file but this looks good. Im pretty confident this makes write threadsafe

This is a good comment. It is also something that should be changed (even if it would work otherwise) so next time leave it as a comment and don't approve the PR.