Skip to content

pthread_t is not treated as opaque #203

@OPNA2608

Description

@OPNA2608

NP2kai/network/net.c

Lines 113 to 115 in 44c8a8c

static pthread_t np2net_hThreadR = NULL; // Read用スレッド
static pthread_t np2net_hThreadW = NULL; // Write用スレッド
static pthread_t np2net_thread_eventhandle = 0; // 送受信要求用

pthread_t is an opaque type defined by the POSIX standard. You may not make any assumptions about what it contains and what can be assigned to it. Platforms are allowed to implement this in any way then see fit - a typedef to an integral type, a more complex struct, a pointer to smth, ...

If PTHREAD_NULL is defined, then it may be used as a NULL-kind of value. But if it is not defined... I don't think you should write to or read from a pthread_t variable without using pthread_* functions.

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