← index #3332Issue #5945
Duplicate · high · value 4.301
QUERY · ISSUE

_thread: timeout parameter is not implemented in Lock.acquire()

openby dlechopened 2017-09-26updated 2024-08-28
py-core

https://github.com/micropython/micropython/blob/62849b7010abffb7b0a9c9875930efe7cb77519c/py/modthread.c#L69


Background:

I'm looking for a way to implement a cancelable timeout on Linux, e.g something like threading.Timer from the standard library.

Being on Linux, I'm thinking of trying a timerfd with uasyncio instead. But if implementing the timeout parameter here is not too hard, I could give it a try. It looks to be platform dependent though, so it might be beyond my capabilities.

CANDIDATE · ISSUE

_thread lock.acquire() timeout not implement ?

closedby water5opened 2020-04-20updated 2020-04-20
py-core

I try:
lock.acquire(1, 3)

but the lock is acquired unconditionally, the timeout parameter not implement currently?

test environment: ESP32, MicroPython v1.12 on 2019-12-20

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied