merge
This commit is contained in:
@@ -87,30 +87,31 @@ class ThreadTests(unittest.TestCase):
|
|||||||
self.assertEqual(numrunning.get(), 0)
|
self.assertEqual(numrunning.get(), 0)
|
||||||
|
|
||||||
# run with a small(ish) thread stack size (256kB)
|
# run with a small(ish) thread stack size (256kB)
|
||||||
def test_various_ops_small_stack(self):
|
if hasattr(threading, 'stack_size'):
|
||||||
if verbose:
|
def test_various_ops_small_stack(self):
|
||||||
print 'with 256kB thread stack size...'
|
|
||||||
try:
|
|
||||||
threading.stack_size(262144)
|
|
||||||
except thread.error:
|
|
||||||
if verbose:
|
if verbose:
|
||||||
print 'platform does not support changing thread stack size'
|
print 'with 256kB thread stack size...'
|
||||||
return
|
try:
|
||||||
self.test_various_ops()
|
threading.stack_size(262144)
|
||||||
threading.stack_size(0)
|
except thread.error:
|
||||||
|
if verbose:
|
||||||
|
print 'platform does not support changing thread stack size'
|
||||||
|
return
|
||||||
|
self.test_various_ops()
|
||||||
|
threading.stack_size(0)
|
||||||
|
|
||||||
# run with a large thread stack size (1MB)
|
# run with a large thread stack size (1MB)
|
||||||
def test_various_ops_large_stack(self):
|
def test_various_ops_large_stack(self):
|
||||||
if verbose:
|
|
||||||
print 'with 1MB thread stack size...'
|
|
||||||
try:
|
|
||||||
threading.stack_size(0x100000)
|
|
||||||
except thread.error:
|
|
||||||
if verbose:
|
if verbose:
|
||||||
print 'platform does not support changing thread stack size'
|
print 'with 1MB thread stack size...'
|
||||||
return
|
try:
|
||||||
self.test_various_ops()
|
threading.stack_size(0x100000)
|
||||||
threading.stack_size(0)
|
except thread.error:
|
||||||
|
if verbose:
|
||||||
|
print 'platform does not support changing thread stack size'
|
||||||
|
return
|
||||||
|
self.test_various_ops()
|
||||||
|
threading.stack_size(0)
|
||||||
|
|
||||||
def test_foreign_thread(self):
|
def test_foreign_thread(self):
|
||||||
# Check that a "foreign" thread can use the threading module.
|
# Check that a "foreign" thread can use the threading module.
|
||||||
|
Reference in New Issue
Block a user