MCPcopy Index your code
hub / github.com/python/cpython / check_enough_semaphores

Function check_enough_semaphores

Lib/test/_test_multiprocessing.py:170–182  ·  view source on GitHub ↗

Check that the system supports enough semaphores to run the test.

()

Source from the content-addressed store, hash-verified

168
169
170def check_enough_semaphores():
171 """Check that the system supports enough semaphores to run the test."""
172 # minimum number of semaphores available according to POSIX
173 nsems_min = 256
174 try:
175 nsems = os.sysconf("SC_SEM_NSEMS_MAX")
176 except (AttributeError, ValueError):
177 # sysconf not available or setting not available
178 return
179 if nsems == -1 or nsems >= nsems_min:
180 return
181 raise unittest.SkipTest("The OS doesn't support enough semaphores "
182 "to run the test (required: %d)." % nsems_min)
183
184
185def only_run_in_spawn_testsuite(reason):

Callers 1

setUpModuleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…