Details
-
Task
-
Status: Stalled (View Workflow)
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
Description
Now all pthread conditions in MariaDB are created with the default attributes. It means that pthread_cond_timedwait() uses "realtime" clock, and changes in the system time (e.g., if the system administrator manually changes the clock) might interrupt timed condition waits. In almost all cases this is not desirable. To fix it, we should use
pthread_condattr_setclock(attr, CLOCK_MONOTONIC)
|
create all conditions with this attribute, and use
clock_gettime(CLOCK_MONOTONIC, ...)
|
when calculating wakeup time.