Skip to content

uv_eio_init calls eio_init multiple times #15

@paddybyers

Description

@paddybyers

uv-eio.c calls eio_init once for each loop.

However, if more than one loop is initialised in any given process, eio_init will be called more than once, which is forbidden.

Normally this is not a problem, but it becomes a problem in applications that wish to have multiple loops in a single process. This behaviour is now sought for the Android port.

One solution - which assumes that pthreads are unconditionally available - is here.

This is perhaps OK, or perhaps the dependency on pthread_once needs to be abstracted to support those unix platforms that don't support this.

On the other hand, the principal thread abstraction is in eio/xthread.h, and eio already has multiple mutexes, so I would have thought that this could be implemented more naturally in eio itself, so eio_init guards itself against multiple calls in the same process. Suggestions welcomed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions