[MDEV-3994] Use CLOCK_MONOTONIC for all pthread_cond_timedwait() Created: 2013-01-01 Updated: 2015-11-17 |
|
| Status: | Stalled |
| Project: | MariaDB Server |
| Component/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Minor |
| Reporter: | Sergei Golubchik | Assignee: | Sergei Golubchik |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| 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
create all conditions with this attribute, and use
when calculating wakeup time. |
| Comments |
| Comment by Sergei Golubchik [ 2014-06-15 ] |
|
Somehow this didn't work. I'm getting lots of timeouts, but in the debugger I see that the current time (yes, CLOCK_MONOTONIC) is clearly less than the wakeup time. |
| Comment by Sergei Golubchik [ 2014-06-16 ] |
|
incomplete WIP patch is attached |