mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Get rid of circular import and eliminate unprefixed exported symbols
from _multiprocessing.
This commit is contained in:
parent
81901490a0
commit
8fb9f4cf7b
3 changed files with 15 additions and 26 deletions
|
@ -193,7 +193,7 @@ semlock_release(SemLockObject *self, PyObject *args)
|
|||
#ifndef HAVE_SEM_TIMEDWAIT
|
||||
# define sem_timedwait(sem,deadline) sem_timedwait_save(sem,deadline,_save)
|
||||
|
||||
int
|
||||
static int
|
||||
sem_timedwait_save(sem_t *sem, struct timespec *deadline, PyThreadState *_save)
|
||||
{
|
||||
int res;
|
||||
|
@ -444,7 +444,7 @@ semlock_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
|||
failure:
|
||||
if (handle != SEM_FAILED)
|
||||
SEM_CLOSE(handle);
|
||||
mp_SetError(NULL, MP_STANDARD_ERROR);
|
||||
_PyMp_SetError(NULL, MP_STANDARD_ERROR);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -491,7 +491,7 @@ semlock_getvalue(SemLockObject *self)
|
|||
#else
|
||||
int sval;
|
||||
if (SEM_GETVALUE(self->handle, &sval) < 0)
|
||||
return mp_SetError(NULL, MP_STANDARD_ERROR);
|
||||
return _PyMp_SetError(NULL, MP_STANDARD_ERROR);
|
||||
/* some posix implementations use negative numbers to indicate
|
||||
the number of waiting threads */
|
||||
if (sval < 0)
|
||||
|
@ -507,16 +507,16 @@ semlock_iszero(SemLockObject *self)
|
|||
if (sem_trywait(self->handle) < 0) {
|
||||
if (errno == EAGAIN)
|
||||
Py_RETURN_TRUE;
|
||||
return mp_SetError(NULL, MP_STANDARD_ERROR);
|
||||
return _PyMp_SetError(NULL, MP_STANDARD_ERROR);
|
||||
} else {
|
||||
if (sem_post(self->handle) < 0)
|
||||
return mp_SetError(NULL, MP_STANDARD_ERROR);
|
||||
return _PyMp_SetError(NULL, MP_STANDARD_ERROR);
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
#else
|
||||
int sval;
|
||||
if (SEM_GETVALUE(self->handle, &sval) < 0)
|
||||
return mp_SetError(NULL, MP_STANDARD_ERROR);
|
||||
return _PyMp_SetError(NULL, MP_STANDARD_ERROR);
|
||||
return PyBool_FromLong((long)sval == 0);
|
||||
#endif
|
||||
}
|
||||
|
@ -574,7 +574,7 @@ static PyMemberDef semlock_members[] = {
|
|||
* Semaphore type
|
||||
*/
|
||||
|
||||
PyTypeObject SemLockType = {
|
||||
PyTypeObject _PyMp_SemLockType = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
/* tp_name */ "_multiprocessing.SemLock",
|
||||
/* tp_basicsize */ sizeof(SemLockObject),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue