mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
gh-110850: Rename internal PyTime C API functions (#115734)
Rename functions: * _PyTime_GetSystemClock() => _PyTime_TimeUnchecked() * _PyTime_GetPerfCounter() => _PyTime_PerfCounterUnchecked() * _PyTime_GetMonotonicClock() => _PyTime_MonotonicUnchecked() * _PyTime_GetSystemClockWithInfo() => _PyTime_TimeWithInfo() * _PyTime_GetMonotonicClockWithInfo() => _PyTime_MonotonicWithInfo() * _PyTime_GetMonotonicClockWithInfo() => _PyTime_MonotonicWithInfo() Changes: * Remove "typedef PyTime_t PyTime_t;" which was "typedef PyTime_t _PyTime_t;" before a previous rename. * Update comments of "Unchecked" functions. * Remove invalid PyTime_Time() comment.
This commit is contained in:
parent
e1fdc3c323
commit
52d1477566
16 changed files with 68 additions and 83 deletions
|
@ -6,7 +6,7 @@
|
|||
#include "pycore_pyerrors.h" // _Py_FatalErrorFormat
|
||||
#include "pycore_pystate.h" // _PyThreadState_GET
|
||||
#include "pycore_semaphore.h" // _PySemaphore
|
||||
#include "pycore_time.h" //_PyTime_GetMonotonicClock()
|
||||
#include "pycore_time.h" //_PyTime_MonotonicUnchecked()
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
|
@ -120,13 +120,13 @@ _PySemaphore_PlatformWait(_PySemaphore *sema, PyTime_t timeout)
|
|||
struct timespec ts;
|
||||
|
||||
#if defined(CLOCK_MONOTONIC) && defined(HAVE_SEM_CLOCKWAIT)
|
||||
PyTime_t deadline = _PyTime_Add(_PyTime_GetMonotonicClock(), timeout);
|
||||
PyTime_t deadline = _PyTime_Add(_PyTime_MonotonicUnchecked(), timeout);
|
||||
|
||||
_PyTime_AsTimespec_clamp(deadline, &ts);
|
||||
|
||||
err = sem_clockwait(&sema->platform_sem, CLOCK_MONOTONIC, &ts);
|
||||
#else
|
||||
PyTime_t deadline = _PyTime_Add(_PyTime_GetSystemClock(), timeout);
|
||||
PyTime_t deadline = _PyTime_Add(_PyTime_TimeUnchecked(), timeout);
|
||||
|
||||
_PyTime_AsTimespec_clamp(deadline, &ts);
|
||||
|
||||
|
@ -163,7 +163,7 @@ _PySemaphore_PlatformWait(_PySemaphore *sema, PyTime_t timeout)
|
|||
_PyTime_AsTimespec_clamp(timeout, &ts);
|
||||
err = pthread_cond_timedwait_relative_np(&sema->cond, &sema->mutex, &ts);
|
||||
#else
|
||||
PyTime_t deadline = _PyTime_Add(_PyTime_GetSystemClock(), timeout);
|
||||
PyTime_t deadline = _PyTime_Add(_PyTime_TimeUnchecked(), timeout);
|
||||
_PyTime_AsTimespec_clamp(deadline, &ts);
|
||||
|
||||
err = pthread_cond_timedwait(&sema->cond, &sema->mutex, &ts);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue