tests/thread: Make stack-size test run correctly and reliable on uPy.
This commit is contained in:
parent
94238d4ae5
commit
5b7789d519
@ -6,7 +6,7 @@ import sys
|
|||||||
import _thread
|
import _thread
|
||||||
|
|
||||||
# different implementations have different minimum sizes
|
# different implementations have different minimum sizes
|
||||||
if sys.implementation == 'micropython':
|
if sys.implementation.name == 'micropython':
|
||||||
sz = 2 * 1024
|
sz = 2 * 1024
|
||||||
else:
|
else:
|
||||||
sz = 32 * 1024
|
sz = 32 * 1024
|
||||||
@ -20,6 +20,9 @@ def thread_entry():
|
|||||||
global n_finished
|
global n_finished
|
||||||
n_finished += 1
|
n_finished += 1
|
||||||
|
|
||||||
|
# reset stack size to default
|
||||||
|
_thread.stack_size()
|
||||||
|
|
||||||
# test set/get of stack size
|
# test set/get of stack size
|
||||||
print(_thread.stack_size())
|
print(_thread.stack_size())
|
||||||
print(_thread.stack_size(sz))
|
print(_thread.stack_size(sz))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user