cygwin: simplify pthread timedwait handling

- Introduce inline helper pthread_convert_abstime.  It converts
  an absolute timespec to a Windows LARGE_INTEGER timestamp,
  depending on the used clock.

- Use this function from pthread_cond_timedwait and semaphore::timedwait

- Merge semaphore::_wait and semaphore::_timedwait into single _wait
  method, taking a LARGER_INTEGER timestamp.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen
2017-08-03 19:08:31 +02:00
parent a346a26790
commit 68217c3178
2 changed files with 60 additions and 66 deletions

View File

@@ -693,11 +693,10 @@ public:
}
private:
int _wait ();
void _post ();
int _getvalue (int *sval);
int _trywait ();
int _timedwait (const struct timespec *abstime);
int _wait (PLARGE_INTEGER timeout = NULL);
void _fixup_before_fork ();
void _fixup_after_fork ();