summaryrefslogtreecommitdiffstats
path: root/Modules/threadmodule.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2002-06-13 20:33:02 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2002-06-13 20:33:02 (GMT)
commit14f8b4cfcb98de74b9c6e9316539be9e2a5cd31f (patch)
tree7b150133cdd51df851c6bdaf261cd9ea30c149af /Modules/threadmodule.c
parent654c11ee3a2c9b72c040524c9cc4f95a1858f20b (diff)
downloadcpython-14f8b4cfcb98de74b9c6e9316539be9e2a5cd31f.zip
cpython-14f8b4cfcb98de74b9c6e9316539be9e2a5cd31f.tar.gz
cpython-14f8b4cfcb98de74b9c6e9316539be9e2a5cd31f.tar.bz2
Patch #568124: Add doc string macros.
Diffstat (limited to 'Modules/threadmodule.c')
-rw-r--r--Modules/threadmodule.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/Modules/threadmodule.c b/Modules/threadmodule.c
index ba149dc..aa9d3c9 100644
--- a/Modules/threadmodule.c
+++ b/Modules/threadmodule.c
@@ -71,7 +71,7 @@ lock_PyThread_acquire_lock(lockobject *self, PyObject *args)
return PyBool_FromLong((long)i);
}
-static char acquire_doc[] =
+PyDoc_STRVAR(acquire_doc,
"acquire([wait]) -> None or bool\n\
(PyThread_acquire_lock() is an obsolete synonym)\n\
\n\
@@ -80,7 +80,7 @@ locked (even by the same thread), waiting for another thread to release\n\
the lock, and return None once the lock is acquired.\n\
With an argument, this will only block if the argument is true,\n\
and the return value reflects whether the lock is acquired.\n\
-The blocking operation is not interruptible.";
+The blocking operation is not interruptible.");
static PyObject *
lock_PyThread_release_lock(lockobject *self)
@@ -97,13 +97,13 @@ lock_PyThread_release_lock(lockobject *self)
return Py_None;
}
-static char release_doc[] =
+PyDoc_STRVAR(release_doc,
"release()\n\
(PyThread_release_lock() is an obsolete synonym)\n\
\n\
Release the lock, allowing another thread that is blocked waiting for\n\
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.";
+but it needn't be locked by the same thread that unlocks it.");
static PyObject *
lock_locked_lock(lockobject *self)
@@ -115,11 +115,11 @@ lock_locked_lock(lockobject *self)
return PyBool_FromLong(1L);
}
-static char locked_doc[] =
+PyDoc_STRVAR(locked_doc,
"locked() -> bool\n\
(locked_lock() is an obsolete synonym)\n\
\n\
-Return whether the lock is in the locked state.";
+Return whether the lock is in the locked state.");
static PyMethodDef lock_methods[] = {
{"acquire_lock", (PyCFunction)lock_PyThread_acquire_lock,
@@ -245,7 +245,7 @@ thread_PyThread_start_new_thread(PyObject *self, PyObject *fargs)
return PyInt_FromLong(ident);
}
-static char start_new_doc[] =
+PyDoc_STRVAR(start_new_doc,
"start_new_thread(function, args[, kwargs])\n\
(start_new() is an obsolete synonym)\n\
\n\
@@ -254,7 +254,7 @@ function with positional arguments from the tuple args and keyword arguments\n\
taken from the optional dictionary kwargs. The thread exits when the\n\
function returns; the return value is ignored. The thread will also exit\n\
when the function raises an unhandled exception; a stack trace will be\n\
-printed unless the exception is SystemExit.\n";
+printed unless the exception is SystemExit.\n");
static PyObject *
thread_PyThread_exit_thread(PyObject *self)
@@ -263,12 +263,12 @@ thread_PyThread_exit_thread(PyObject *self)
return NULL;
}
-static char exit_doc[] =
+PyDoc_STRVAR(exit_doc,
"exit()\n\
(PyThread_exit_thread() is an obsolete synonym)\n\
\n\
This is synonymous to ``raise SystemExit''. It will cause the current\n\
-thread to exit silently unless the exception is caught.";
+thread to exit silently unless the exception is caught.");
#ifndef NO_EXIT_PROG
static PyObject *
@@ -288,11 +288,11 @@ thread_PyThread_allocate_lock(PyObject *self)
return (PyObject *) newlockobject();
}
-static char allocate_doc[] =
+PyDoc_STRVAR(allocate_doc,
"allocate_lock() -> lock object\n\
(allocate() is an obsolete synonym)\n\
\n\
-Create a new lock object. See LockType.__doc__ for information about locks.";
+Create a new lock object. See LockType.__doc__ for information about locks.");
static PyObject *
thread_get_ident(PyObject *self)
@@ -306,7 +306,7 @@ thread_get_ident(PyObject *self)
return PyInt_FromLong(ident);
}
-static char get_ident_doc[] =
+PyDoc_STRVAR(get_ident_doc,
"get_ident() -> integer\n\
\n\
Return a non-zero integer that uniquely identifies the current thread\n\
@@ -315,7 +315,7 @@ This may be used to identify per-thread resources.\n\
Even though on some platforms threads identities may appear to be\n\
allocated consecutive numbers starting at 1, this behavior should not\n\
be relied upon, and the number should be seen purely as a magic cookie.\n\
-A thread's identity may be reused for another thread after it exits.";
+A thread's identity may be reused for another thread after it exits.");
static PyMethodDef thread_methods[] = {
{"start_new_thread", (PyCFunction)thread_PyThread_start_new_thread,
@@ -344,11 +344,11 @@ static PyMethodDef thread_methods[] = {
/* Initialization function */
-static char thread_doc[] =
+PyDoc_STRVAR(thread_doc,
"This module provides primitive operations to write multi-threaded programs.\n\
-The 'threading' module provides a more convenient interface.";
+The 'threading' module provides a more convenient interface.");
-static char lock_doc[] =
+PyDoc_STRVAR(lock_doc,
"A lock object is a synchronization primitive. To create a lock,\n\
call the PyThread_allocate_lock() function. Methods are:\n\
\n\
@@ -358,7 +358,7 @@ locked() -- test whether the lock is currently locked\n\
\n\
A lock is not owned by the thread that locked it; another thread may\n\
unlock it. A thread attempting to lock a lock that it has already locked\n\
-will block until another thread unlocks it. Deadlocks may ensue.";
+will block until another thread unlocks it. Deadlocks may ensue.");
DL_EXPORT(void)
initthread(void)