mirror of
https://github.com/python/cpython.git
synced 2025-08-15 22:30:42 +00:00
Merged revisions 85586-85587,85596-85598 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r85586 | gregory.p.smith | 2010-10-16 17:17:24 -0700 (Sat, 16 Oct 2010) | 2 lines fix for netbsd. ........ r85587 | gregory.p.smith | 2010-10-16 17:43:10 -0700 (Sat, 16 Oct 2010) | 3 lines applying netbsd-wizs-mod.patch from issue5510 - fixes for netbsd (and dragonflybsd?) ........ r85596 | gregory.p.smith | 2010-10-16 19:14:36 -0700 (Sat, 16 Oct 2010) | 6 lines Fix multiprocessing Semaphore's on netbsd5. SEM_VALUE_MAX is defined as (~0U) on NetBSD which was causing it to appear as -1 when used as a signed int for _multprocessing.SemLock.SEM_VALUE_MAX. This works around the problem by substituting INT_MAX on systems where it appears negative when used as an int. ........ r85597 | gregory.p.smith | 2010-10-16 19:57:19 -0700 (Sat, 16 Oct 2010) | 2 lines skip test_itimer_virtual on NetBSD to prevent the test suite from hanging. ........ r85598 | gregory.p.smith | 2010-10-16 20:09:12 -0700 (Sat, 16 Oct 2010) | 2 lines Avoid hanging the test on netbsd5. ........
This commit is contained in:
parent
6913cb0373
commit
886a1cd7dc
5 changed files with 46 additions and 9 deletions
|
@ -256,8 +256,19 @@ init_multiprocessing(void)
|
|||
if (PyType_Ready(&SemLockType) < 0)
|
||||
return;
|
||||
Py_INCREF(&SemLockType);
|
||||
PyDict_SetItemString(SemLockType.tp_dict, "SEM_VALUE_MAX",
|
||||
Py_BuildValue("i", SEM_VALUE_MAX));
|
||||
{
|
||||
PyObject *py_sem_value_max;
|
||||
/* Some systems define SEM_VALUE_MAX as an unsigned value that
|
||||
* causes it to be negative when used as an int (NetBSD). */
|
||||
if ((int)(SEM_VALUE_MAX) < 0)
|
||||
py_sem_value_max = PyLong_FromLong(INT_MAX);
|
||||
else
|
||||
py_sem_value_max = PyLong_FromLong(SEM_VALUE_MAX);
|
||||
if (py_sem_value_max == NULL)
|
||||
return NULL;
|
||||
PyDict_SetItemString(SemLockType.tp_dict, "SEM_VALUE_MAX",
|
||||
py_sem_value_max);
|
||||
}
|
||||
PyModule_AddObject(module, "SemLock", (PyObject*)&SemLockType);
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue