Changes between Initial Version and Version 1 of Ticket #1729, comment 19


Ignore:
Timestamp:
Dec 2, 2012, 3:01:41 PM (11 years ago)
Author:
Jan Wassenberg

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #1729, comment 19

    initial v1  
    22
    33The trouble with printf and debug_printf is that they take locks. Besides the speed hit, that will also serialize threads and change execution. It really sounds like this is a race condition. I've been developing on 64-bit CPUs for the past few years, and this code seems to assume 64-bit reads are atomic. That does not hold for our 32-bit app.
    4 Please try the simple and straightforward solution of using a pthread_mutex (with PTHREAD_MUTEX_INITIALIZE) in that function to serialize updates to the "max time", which should then be a double.
     4Please try the simple and straightforward solution of using a pthread_mutex (with PTHREAD_MUTEX_INITIALIZER) in that function to serialize updates to the "max time", which should then be a double.