Skip to content

Binary Semaphore Can not be set 0 when it create #8

Description

@bacinchel

if ( sem_initial_value > 1 )

I think this statement has a problem.

If I input semaphore with initial value 0, this statement ignores input value 0 and make it 1

Is there any other intention that I missed?

if not I recommend to fix statement
if (sem_initial_value < 0) >>> if (sem_initial_value <= 0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    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