Duplicate function in thread_pthread.h

Inada Naoki songofacandy at gmail.com
Tue May 28 00:11:58 EDT 2019


Do you know C macros?
Two implementations is switched by USE_SEMAPHORES.

#ifdef USE_SEMAPHORES
...
void
PyThread_free_lock(PyThread_type_lock lock)
...
#else /* USE_SEMAPHORES */
...
void
PyThread_free_lock(PyThread_type_lock lock)
...
#endif /* USE_SEMAPHORES */

On Tue, May 28, 2019 at 12:58 PM Windson Yang <wiwindson at gmail.com> wrote:
>
> When I try to understand the code about the thread. I found
> the thread_pthread.h file has some duplicate functions. Like
> `PyThread_free_lock`, `PyThread_release_lock`,
> `PyThread_acquire_lock_timed`. IIUC, C doesn't support function overload.
> So why we have functions with the same name and args?
> --
> https://mail.python.org/mailman/listinfo/python-list



-- 
Inada Naoki  <songofacandy at gmail.com>


More information about the Python-list mailing list