Skip to content

[BUG]: cthreads_thread_detach does not return 0 upon success for windows threads #8

@RealTrippR

Description

@RealTrippR

cthreads_thread_detach does not return 0 upon success for Windows builds of Cthreads, which is contrary to its description stating that it "returns 0 on success, non-zero error code on failure."

cthreads_thread_detach makes a call to CloseHandle, which upon success returns a non-zero value and upon failure returns 0. cthreads_thread_detach simply returns this value without inverting it to match the description.

This is a very simple fix.
Line 73 of cthreads.c should be changed from return CloseHandle(thread.wThread); to return CloseHandle(thread.wThread)==0;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions