Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
b6d4ee53
Kaydet (Commit)
b6d4ee53
authored
Kas 17, 2010
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #10440: Support RUSAGE_THREAD as a constant in the resource module.
Patch by Robert Collins.
üst
dc817b22
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
4 deletions
+22
-4
resource.rst
Doc/library/resource.rst
+11
-4
test_resource.py
Lib/test/test_resource.py
+4
-0
NEWS
Misc/NEWS
+3
-0
resource.c
Modules/resource.c
+4
-0
No files found.
Doc/library/resource.rst
Dosyayı görüntüle @
b6d4ee53
...
@@ -217,14 +217,14 @@ function to specify which processes information should be provided for.
...
@@ -217,14 +217,14 @@ function to specify which processes information should be provided for.
.. data:: RUSAGE_SELF
.. data:: RUSAGE_SELF
:const:`RUSAGE_SELF` should be used to request information pertaining only to
Pass to :func:`getrusage` to request resources consumed by the calling
the process itself
.
process, which is the sum of resources used by all threads in the process
.
.. data:: RUSAGE_CHILDREN
.. data:: RUSAGE_CHILDREN
Pass to :func:`getrusage` to request resource
information for child processes of
Pass to :func:`getrusage` to request resource
s consumed by child processes
the calling process
.
of the calling process which have been terminated and waited for
.
.. data:: RUSAGE_BOTH
.. data:: RUSAGE_BOTH
...
@@ -232,3 +232,10 @@ function to specify which processes information should be provided for.
...
@@ -232,3 +232,10 @@ function to specify which processes information should be provided for.
Pass to :func:`getrusage` to request resources consumed by both the current
Pass to :func:`getrusage` to request resources consumed by both the current
process and child processes. May not be available on all systems.
process and child processes. May not be available on all systems.
.. data:: RUSAGE_THREAD
Pass to :func:`getrusage` to request resources consumed by the current
thread. May not be available on all systems.
.. versionadded:: 3.2
Lib/test/test_resource.py
Dosyayı görüntüle @
b6d4ee53
...
@@ -102,6 +102,10 @@ class ResourceTest(unittest.TestCase):
...
@@ -102,6 +102,10 @@ class ResourceTest(unittest.TestCase):
usageboth
=
resource
.
getrusage
(
resource
.
RUSAGE_BOTH
)
usageboth
=
resource
.
getrusage
(
resource
.
RUSAGE_BOTH
)
except
(
ValueError
,
AttributeError
):
except
(
ValueError
,
AttributeError
):
pass
pass
try
:
usage_thread
=
resource
.
getrusage
(
resource
.
RUSAGE_THREAD
)
except
(
ValueError
,
AttributeError
):
pass
def
test_main
(
verbose
=
None
):
def
test_main
(
verbose
=
None
):
support
.
run_unittest
(
ResourceTest
)
support
.
run_unittest
(
ResourceTest
)
...
...
Misc/NEWS
Dosyayı görüntüle @
b6d4ee53
...
@@ -13,6 +13,9 @@ Core and Builtins
...
@@ -13,6 +13,9 @@ Core and Builtins
Library
Library
-------
-------
- Issue #10440: Support RUSAGE_THREAD as a constant in the resource module.
Patch by Robert Collins.
- Issue #10429: IMAP.starttls() stored the capabilities as bytes objects,
- Issue #10429: IMAP.starttls() stored the capabilities as bytes objects,
rather than strings.
rather than strings.
...
...
Modules/resource.c
Dosyayı görüntüle @
b6d4ee53
...
@@ -325,6 +325,10 @@ PyInit_resource(void)
...
@@ -325,6 +325,10 @@ PyInit_resource(void)
PyModule_AddIntConstant
(
m
,
"RUSAGE_BOTH"
,
RUSAGE_BOTH
);
PyModule_AddIntConstant
(
m
,
"RUSAGE_BOTH"
,
RUSAGE_BOTH
);
#endif
#endif
#ifdef RUSAGE_THREAD
PyModule_AddIntConstant
(
m
,
"RUSAGE_THREAD"
,
RUSAGE_THREAD
);
#endif
#if defined(HAVE_LONG_LONG)
#if defined(HAVE_LONG_LONG)
if
(
sizeof
(
RLIM_INFINITY
)
>
sizeof
(
long
))
{
if
(
sizeof
(
RLIM_INFINITY
)
>
sizeof
(
long
))
{
v
=
PyLong_FromLongLong
((
PY_LONG_LONG
)
RLIM_INFINITY
);
v
=
PyLong_FromLongLong
((
PY_LONG_LONG
)
RLIM_INFINITY
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment