• David Lechner's avatar
    py/modthread: Return thread id from start_new_thread(). · ffb43b2d
    David Lechner authored
    
    
    In CPython, `_thread.start_new_thread()` returns an ID that is the same ID
    that is returned by `_thread.get_ident()`.  The current MicroPython
    implementation of `_thread.start_new_thread()` always returns `None`.
    
    This modifies the required functions to return a value. The native thread
    id is returned since this can be used for interop with other functions, for
    example, `pthread_kill()` on *nix. `_thread.get_ident()` is also modified
    to return the native thread id so that the values match and avoids the need
    for a separate `native_id` attribute.
    
    Fixes issue #12153.
    Signed-off-by: default avatarDavid Lechner <david@pybricks.com>
    ffb43b2d
mpthread.h 2.28 KB