awslabs / amazon-kinesis-video-streams-pic

Apache License 2.0
49 stars 51 forks source link

safe gmtime, guard with mutex since not thread safe on non windows pl… #240

Closed hassanctech closed 9 months ago

hassanctech commented 9 months ago

Issue #, if available: Address TSAN failures in Producer C

Description of changes: C function gmtime is not threadsafe on non-windows platforms. Create a new GMTIME_SAFE macro which guards the gmtime call with a global mutex.

The if/def for this includes CYGWIN because I'm using pthread which our Thread platform dependent layer does not use for cygwin.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

codecov-commenter commented 9 months ago

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (8216b98) 80.35% compared to head (89ceb16) 80.31%.

:exclamation: Current head 89ceb16 differs from pull request most recent head 9a63a34. Consider uploading reports for the commit 9a63a34 to get more accurate results

Files Patch % Lines
src/utils/src/Time.c 87.50% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #240 +/- ## =========================================== - Coverage 80.35% 80.31% -0.05% =========================================== Files 53 53 Lines 10798 10804 +6 =========================================== Hits 8677 8677 - Misses 2121 2127 +6 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.