Skip to content

Commit

Permalink
sched/semaphore: change semcount type to int
Browse files Browse the repository at this point in the history
Some memory on the ESP32 requires aligned access,
so the semcount type has been changed to int.

Signed-off-by: zhangyuan29 <[email protected]>
  • Loading branch information
zyfeier committed Nov 4, 2024
1 parent 38fbb4e commit 7beaffc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/semaphore.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ struct semholder_s

struct sem_s
{
volatile int16_t semcount; /* >0 -> Num counts available */
volatile int semcount; /* >0 -> Num counts available */
/* <0 -> Num tasks waiting for semaphore */

/* If priority inheritance is enabled, then we have to keep track of which
Expand Down
2 changes: 1 addition & 1 deletion sched/semaphore/semaphore.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* Pre-processor Definitions
****************************************************************************/

#define NXSEM_COUNT(s) ((FAR atomic_short *)&(s)->semcount)
#define NXSEM_COUNT(s) ((FAR atomic_int *)&(s)->semcount)

/****************************************************************************
* Public Function Prototypes
Expand Down

0 comments on commit 7beaffc

Please sign in to comment.