summaryrefslogtreecommitdiffstats
path: root/Modules/threadmodule.c
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2002-03-25 20:46:46 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2002-03-25 20:46:46 (GMT)
commit3a6f97850b2a4071f3015033fa3d68ce6fa576f4 (patch)
tree46311b5e874d4c733748e5a20de70336bf282323 /Modules/threadmodule.c
parent57f8e06e4f797abe4d2cbb41a298c5541f69b7f6 (diff)
downloadcpython-3a6f97850b2a4071f3015033fa3d68ce6fa576f4.zip
cpython-3a6f97850b2a4071f3015033fa3d68ce6fa576f4.tar.gz
cpython-3a6f97850b2a4071f3015033fa3d68ce6fa576f4.tar.bz2
Remove many uses of PyArg_NoArgs macro, change METH_OLDARGS to METH_NOARGS.
Diffstat (limited to 'Modules/threadmodule.c')
-rw-r--r--Modules/threadmodule.c32
1 files changed, 10 insertions, 22 deletions
diff --git a/Modules/threadmodule.c b/Modules/threadmodule.c
index dfc5cbe..cf4d3d5 100644
--- a/Modules/threadmodule.c
+++ b/Modules/threadmodule.c
@@ -87,11 +87,8 @@ and the return value reflects whether the lock is acquired.\n\
The blocking operation is not interruptible.";
static PyObject *
-lock_PyThread_release_lock(lockobject *self, PyObject *args)
+lock_PyThread_release_lock(lockobject *self)
{
- if (!PyArg_NoArgs(args))
- return NULL;
-
/* Sanity check: the lock must be locked */
if (PyThread_acquire_lock(self->lock_lock, 0)) {
PyThread_release_lock(self->lock_lock);
@@ -113,11 +110,8 @@ the lock to acquire the lock. The lock must be in the locked state,\n\
but it needn't be locked by the same thread that unlocks it.";
static PyObject *
-lock_locked_lock(lockobject *self, PyObject *args)
+lock_locked_lock(lockobject *self)
{
- if (!PyArg_NoArgs(args))
- return NULL;
-
if (PyThread_acquire_lock(self->lock_lock, 0)) {
PyThread_release_lock(self->lock_lock);
return PyInt_FromLong(0L);
@@ -137,11 +131,11 @@ static PyMethodDef lock_methods[] = {
{"acquire", (PyCFunction)lock_PyThread_acquire_lock,
METH_OLDARGS, acquire_doc},
{"release_lock", (PyCFunction)lock_PyThread_release_lock,
- METH_OLDARGS, release_doc},
+ METH_NOARGS, release_doc},
{"release", (PyCFunction)lock_PyThread_release_lock,
METH_OLDARGS, release_doc},
{"locked_lock", (PyCFunction)lock_locked_lock,
- METH_OLDARGS, locked_doc},
+ METH_NOARGS, locked_doc},
{"locked", (PyCFunction)lock_locked_lock,
METH_OLDARGS, locked_doc},
{NULL, NULL} /* sentinel */
@@ -267,10 +261,8 @@ when the function raises an unhandled exception; a stack trace will be\n\
printed unless the exception is SystemExit.\n";
static PyObject *
-thread_PyThread_exit_thread(PyObject *self, PyObject *args)
+thread_PyThread_exit_thread(PyObject *self)
{
- if (!PyArg_NoArgs(args))
- return NULL;
PyErr_SetNone(PyExc_SystemExit);
return NULL;
}
@@ -295,10 +287,8 @@ thread_PyThread_exit_prog(PyObject *self, PyObject *args)
#endif
static PyObject *
-thread_PyThread_allocate_lock(PyObject *self, PyObject *args)
+thread_PyThread_allocate_lock(PyObject *self)
{
- if (!PyArg_NoArgs(args))
- return NULL;
return (PyObject *) newlockobject();
}
@@ -309,11 +299,9 @@ static char allocate_doc[] =
Create a new lock object. See LockType.__doc__ for information about locks.";
static PyObject *
-thread_get_ident(PyObject *self, PyObject *args)
+thread_get_ident(PyObject *self)
{
long ident;
- if (!PyArg_NoArgs(args))
- return NULL;
ident = PyThread_get_thread_ident();
if (ident == -1) {
PyErr_SetString(ThreadError, "no current thread ident");
@@ -341,15 +329,15 @@ static PyMethodDef thread_methods[] = {
METH_VARARGS,
start_new_doc},
{"allocate_lock", (PyCFunction)thread_PyThread_allocate_lock,
- METH_OLDARGS, allocate_doc},
+ METH_NOARGS, allocate_doc},
{"allocate", (PyCFunction)thread_PyThread_allocate_lock,
METH_OLDARGS, allocate_doc},
{"exit_thread", (PyCFunction)thread_PyThread_exit_thread,
- METH_OLDARGS, exit_doc},
+ METH_NOARGS, exit_doc},
{"exit", (PyCFunction)thread_PyThread_exit_thread,
METH_OLDARGS, exit_doc},
{"get_ident", (PyCFunction)thread_get_ident,
- METH_OLDARGS, get_ident_doc},
+ METH_NOARGS, get_ident_doc},
#ifndef NO_EXIT_PROG
{"exit_prog", (PyCFunction)thread_PyThread_exit_prog},
#endif