xiaoxiang781216 merged PR #16194:
URL: https://github.com/apache/nuttx/pull/16194
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscr...@nu
xiaoxiang781216 commented on PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#issuecomment-2857383471
OK, thanks for the detailed explanation, ti's clear to me that we need at
least one holder for binary semaphore.
--
This is an automated message from the Apache Git Service.
To
jlaitine commented on PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#issuecomment-2857114818
As this seems to be difficult subject, I'll try to explain how the priority
boost and restore works here, and why the thread/TCB needs to keep a list of
priority boosts. It is not really
xiaoxiang781216 commented on PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#issuecomment-2856829299
> > But POSIX never define the priority inheritance and priority ceiling for
counting semaphore.
>
> As I said, the logic is there to support necessary priority inheritance
xiaoxiang781216 commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2076652731
##
sched/semaphore/sem_post.c:
##
@@ -116,7 +153,10 @@ int nxsem_post_slow(FAR sem_t *sem)
* initialized if the semaphore is to used for signaling purposes.
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2076136934
##
sched/semaphore/sem_post.c:
##
@@ -116,7 +153,10 @@ int nxsem_post_slow(FAR sem_t *sem)
* initialized if the semaphore is to used for signaling purposes.
*/
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2076136934
##
sched/semaphore/sem_post.c:
##
@@ -116,7 +153,10 @@ int nxsem_post_slow(FAR sem_t *sem)
* initialized if the semaphore is to used for signaling purposes.
*/
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2076132252
##
sched/semaphore/sem_wait.c:
##
@@ -126,6 +171,13 @@ int nxsem_wait_slow(FAR sem_t *sem)
rtcb->waitobj = sem;
+ /* In case of a mutex, store the prev
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2076134668
##
sched/semaphore/sem_post.c:
##
@@ -116,7 +153,10 @@ int nxsem_post_slow(FAR sem_t *sem)
* initialized if the semaphore is to used for signaling purposes.
*/
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2076132252
##
sched/semaphore/sem_wait.c:
##
@@ -126,6 +171,13 @@ int nxsem_wait_slow(FAR sem_t *sem)
rtcb->waitobj = sem;
+ /* In case of a mutex, store the prev
xiaoxiang781216 commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2076022628
##
sched/semaphore/sem_post.c:
##
@@ -116,7 +153,10 @@ int nxsem_post_slow(FAR sem_t *sem)
* initialized if the semaphore is to used for signaling purposes.
patacongo commented on PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#issuecomment-2854789114
> But POSIX never define the priority inheritance and priority ceiling for
counting semaphore.
As I said, the logic is there to support necessary priority inheritance in a
realti
xiaoxiang781216 commented on PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#issuecomment-2854788694
> > 2. Remove the code which track multiple holder for counting semaphore
since it never work as expect and impact the real time
>
> "never work as expect" _might_ not be co
pussuw commented on PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#issuecomment-2854759698
> Counting semaphore is normally waited(event) in one thread, but
posted(event) in another thread(or even interrupt context) yes in this case
using priority inheritance is totally wrong. F
jlaitine commented on PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#issuecomment-2854746686
> 2. Remove the code which track multiple holder for counting semaphore
since it never work as expect and impact the real time
"never work as expect" *might* not be correct. I do a
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2075559102
##
sched/semaphore/sem_post.c:
##
@@ -85,19 +87,54 @@ int nxsem_post_slow(FAR sem_t *sem)
flags = enter_critical_section();
- /* Check the maximum allowable va
xiaoxiang781216 commented on PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#issuecomment-2854659321
> > @patacongo could you give some comment about this problem?
>
> If this feature is removed, you will re-introduce priority inheritance
issues and damage realtime performa
patacongo commented on PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#issuecomment-2854544906
> @patacongo could you give some comment about this problem?
If this feature is removed, you will re-introduce priority inheritance
issues and damage realtime performance. That i
xiaoxiang781216 commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2075344025
##
sched/semaphore/sem_waitirq.c:
##
@@ -72,31 +72,54 @@ void nxsem_wait_irq(FAR struct tcb_s *wtcb, int errcode)
{
FAR struct tcb_s *rtcb = this_task();
xiaoxiang781216 commented on PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#issuecomment-2854058081
> > It doesn't make sense to boost the thread which pass nxsem_wait on a
counting semaphore, since the priority boost is meaningful only for a
mutex(binary semaphore). That's why
xiaoxiang781216 commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2075158766
##
sched/semaphore/sem_waitirq.c:
##
@@ -72,31 +72,55 @@ void nxsem_wait_irq(FAR struct tcb_s *wtcb, int errcode)
{
FAR struct tcb_s *rtcb = this_task();
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2074862627
##
libs/libc/semaphore/sem_getvalue.c:
##
@@ -65,7 +69,23 @@ int nxsem_get_value(FAR sem_t *sem, FAR int *sval)
{
if (sem != NULL && sval != NULL)
{
- *s
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2074866117
##
libs/libc/semaphore/sem_getvalue.c:
##
@@ -67,25 +63,9 @@
int nxsem_get_value(FAR sem_t *sem, FAR int *sval)
{
- if (sem != NULL && sval != NULL)
+ if (sem !=
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2074856652
##
include/nuttx/mutex.h:
##
@@ -354,407 +384,497 @@ void nxmutex_reset(FAR mutex_t *mutex);
*
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2074827578
##
sched/semaphore/sem_waitirq.c:
##
@@ -72,31 +72,55 @@ void nxsem_wait_irq(FAR struct tcb_s *wtcb, int errcode)
{
FAR struct tcb_s *rtcb = this_task();
FAR se
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2074821911
##
sched/semaphore/sem_trywait.c:
##
@@ -63,8 +63,11 @@
int nxsem_trywait_slow(FAR sem_t *sem)
{
irqstate_t flags;
- int32_t semcount;
- int ret;
+ int ret = -
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2074810210
##
sched/semaphore/sem_destroy.c:
##
@@ -61,6 +61,9 @@
int nxsem_destroy(FAR sem_t *sem)
{
int32_t old;
+ bool mutex = NXSEM_IS_MUTEX(sem);
+ FAR atomic_t *cons
jlaitine commented on PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#issuecomment-2853411481
> It doesn't make sense to boost the thread which pass nxsem_wait on a
counting semaphore, since the priority boost is meaningful only for a
mutex(binary semaphore). That's why I sug
xiaoxiang781216 commented on PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#issuecomment-2853378798
> > @jlaitine after this patchset get merged, we can simplify the holder
logic for priority inheritance since:
> >
> > 1. Don't track the multiple holders since mutex always
jlaitine commented on PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#issuecomment-2853322370
> @jlaitine after this patchset get merged, we can simplify the holder logic
for priority inheritance since:
>
> 1. Don't track the multiple holders since mutex always can have one
xiaoxiang781216 commented on PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#issuecomment-2851402290
@jlaitine after this patchset get merged, we can simplify the holder logic
for priority inheritance since:
1. Don't track the multiple holders since mutex always can have on
xiaoxiang781216 commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2073187368
##
libs/libc/semaphore/sem_getvalue.c:
##
@@ -65,7 +69,23 @@ int nxsem_get_value(FAR sem_t *sem, FAR int *sval)
{
if (sem != NULL && sval != NULL)
{
-
jlaitine commented on PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#issuecomment-2847119201
> > > > since the current code base never add const to the local integer
variables even they doesn't change after initialization.
> > >
> > >
> > > Why not? I'll change this if
jlaitine commented on PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#issuecomment-2846715665
Fixed one style review comment which I missed before ( change of dq_peek()
!= NULL -> !dq_empty() )
--
This is an automated message from the Apache Git Service.
To respond to the messa
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2071315661
##
sched/semaphore/sem_wait.c:
##
@@ -86,19 +89,62 @@ int nxsem_wait_slow(FAR sem_t *sem)
/* Check if the lock is available */
- if (atomic_fetch_sub(NXSEM_COU
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2071315094
##
sched/semaphore/sem_reset.c:
##
@@ -76,38 +81,65 @@ int nxsem_reset(FAR sem_t *sem, int16_t count)
flags = enter_critical_section();
- /* A negative count i
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2071312619
##
sched/semaphore/sem_wait.c:
##
@@ -86,19 +89,62 @@ int nxsem_wait_slow(FAR sem_t *sem)
/* Check if the lock is available */
- if (atomic_fetch_sub(NXSEM_COU
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2071312619
##
sched/semaphore/sem_wait.c:
##
@@ -86,19 +89,62 @@ int nxsem_wait_slow(FAR sem_t *sem)
/* Check if the lock is available */
- if (atomic_fetch_sub(NXSEM_COU
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2071307167
##
sched/semaphore/sem_trywait.c:
##
@@ -74,29 +77,57 @@ int nxsem_trywait_slow(FAR sem_t *sem)
/* If the semaphore is available, give it to the requesting task *
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2071307942
##
sched/semaphore/sem_wait.c:
##
@@ -71,9 +71,12 @@
int nxsem_wait_slow(FAR sem_t *sem)
{
- FAR struct tcb_s *rtcb;
+ FAR struct tcb_s *rtcb = this_task();
i
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2071291015
##
include/nuttx/semaphore.h:
##
@@ -45,23 +45,42 @@
/* semcount, flags, waitlist, hhead */
#define NXSEM_INITIALIZER(c, f) \
- {(c), (f), SEM_WAITLIST_I
xiaoxiang781216 commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2067898824
##
sched/semaphore/sem_post.c:
##
@@ -73,10 +73,12 @@ int nxsem_post_slow(FAR sem_t *sem)
{
FAR struct tcb_s *stcb = NULL;
irqstate_t flags;
- int32_t s
xiaoxiang781216 commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2067898000
##
sched/semaphore/sem_destroy.c:
##
@@ -61,6 +61,9 @@
int nxsem_destroy(FAR sem_t *sem)
{
int32_t old;
+ const bool mutex = NXSEM_IS_MUTEX(sem);
+ FAR a
xiaoxiang781216 commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2067740893
##
sched/semaphore/sem_post.c:
##
@@ -156,7 +195,17 @@ int nxsem_post_slow(FAR sem_t *sem)
* it is awakened.
*/
- nxsem_add_h
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2065980010
##
libs/libc/misc/lib_mutex.c:
##
@@ -195,9 +140,11 @@ bool nxmutex_is_hold(FAR mutex_t *mutex)
*
*
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2065979507
##
libs/libc/misc/lib_mutex.c:
##
@@ -177,7 +122,7 @@ int nxmutex_destroy(FAR mutex_t *mutex)
bool nxmutex_is_hold(FAR mutex_t *mutex)
Review Comment:
_SCHED_GE
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2065975368
##
libs/libc/misc/lib_mutex.c:
##
@@ -120,7 +98,6 @@ int nxmutex_init(FAR mutex_t *mutex)
return ret;
}
- mutex->holder = NXMUTEX_NO_HOLDER;
Review Com
xiaoxiang781216 commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2065671928
##
include/nuttx/semaphore.h:
##
@@ -45,23 +45,42 @@
/* semcount, flags, waitlist, hhead */
#define NXSEM_INITIALIZER(c, f) \
- {(c), (f), SEM_WAI
jlaitine commented on PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#issuecomment-2837573228
A bunch of style changes just to please some reviewers, no functional change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to Gi
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r206613
##
sched/semaphore/sem_destroy.c:
##
@@ -61,6 +61,9 @@
int nxsem_destroy(FAR sem_t *sem)
{
int32_t old;
+ const bool mutex = NXSEM_IS_MUTEX(sem);
+ FAR atomic_t
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2065541572
##
sched/semaphore/sem_post.c:
##
@@ -156,7 +195,17 @@ int nxsem_post_slow(FAR sem_t *sem)
* it is awakened.
*/
- nxsem_add_holder_t
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2065542615
##
sched/semaphore/sem_reset.c:
##
@@ -76,38 +81,65 @@ int nxsem_reset(FAR sem_t *sem, int16_t count)
flags = enter_critical_section();
- /* A negative count i
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2065540627
##
sched/semaphore/sem_post.c:
##
@@ -85,19 +87,54 @@ int nxsem_post_slow(FAR sem_t *sem)
flags = enter_critical_section();
- /* Check the maximum allowable va
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2065540110
##
sched/semaphore/sem_post.c:
##
@@ -73,10 +73,12 @@ int nxsem_post_slow(FAR sem_t *sem)
{
FAR struct tcb_s *stcb = NULL;
irqstate_t flags;
- int32_t sem_coun
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2065539704
##
sched/semaphore/sem_post.c:
##
@@ -85,19 +87,54 @@ int nxsem_post_slow(FAR sem_t *sem)
flags = enter_critical_section();
- /* Check the maximum allowable va
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2065538672
##
sched/semaphore/sem_holder.c:
##
@@ -876,7 +876,9 @@ void nxsem_canceled(FAR struct tcb_s *stcb, FAR sem_t *sem)
{
/* Check our assumptions */
- DEBUGASSERT(
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2065537698
##
sched/semaphore/sem_holder.c:
##
@@ -876,7 +876,9 @@ void nxsem_canceled(FAR struct tcb_s *stcb, FAR sem_t *sem)
{
/* Check our assumptions */
- DEBUGASSERT(
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2063564754
##
include/nuttx/semaphore.h:
##
@@ -45,23 +45,42 @@
/* semcount, flags, waitlist, hhead */
#define NXSEM_INITIALIZER(c, f) \
- {(c), (f), SEM_WAITLIST_I
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2063569782
##
sched/semaphore/sem_waitirq.c:
##
@@ -72,30 +72,54 @@ void nxsem_wait_irq(FAR struct tcb_s *wtcb, int errcode)
{
FAR struct tcb_s *rtcb = this_task();
FAR se
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2063564754
##
include/nuttx/semaphore.h:
##
@@ -45,23 +45,42 @@
/* semcount, flags, waitlist, hhead */
#define NXSEM_INITIALIZER(c, f) \
- {(c), (f), SEM_WAITLIST_I
jlaitine commented on PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#issuecomment-2834159189
> > > since the current code base never add const to the local integer
variables even they doesn't change after initialization.
> >
> >
> > Why not? I'll change this if I get a
xiaoxiang781216 commented on PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#issuecomment-2834063080
> > since the current code base never add const to the local integer
variables even they doesn't change after initialization.
>
> Why not? I'll change this if I get a second
xiaoxiang781216 commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2062926746
##
sched/semaphore/sem_waitirq.c:
##
@@ -72,30 +72,54 @@ void nxsem_wait_irq(FAR struct tcb_s *wtcb, int errcode)
{
FAR struct tcb_s *rtcb = this_task();
xiaoxiang781216 commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2062917757
##
include/nuttx/semaphore.h:
##
@@ -45,23 +45,42 @@
/* semcount, flags, waitlist, hhead */
#define NXSEM_INITIALIZER(c, f) \
- {(c), (f), SEM_WAI
jlaitine commented on PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#issuecomment-2834026328
> since the current code base never add const to the local integer variables
even they doesn't change after initialization.
Why not?
--
This is an automated message from
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2062913438
##
libs/libc/misc/lib_mutex.c:
##
@@ -35,30 +35,14 @@
* Pre-processor Definitions
/
-
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2062913034
##
sched/semaphore/sem_waitirq.c:
##
@@ -72,30 +72,54 @@ void nxsem_wait_irq(FAR struct tcb_s *wtcb, int errcode)
{
FAR struct tcb_s *rtcb = this_task();
FAR se
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2062910152
##
include/nuttx/semaphore.h:
##
@@ -45,23 +45,42 @@
/* semcount, flags, waitlist, hhead */
#define NXSEM_INITIALIZER(c, f) \
- {(c), (f), SEM_WAITLIST_I
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2062910152
##
include/nuttx/semaphore.h:
##
@@ -45,23 +45,42 @@
/* semcount, flags, waitlist, hhead */
#define NXSEM_INITIALIZER(c, f) \
- {(c), (f), SEM_WAITLIST_I
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2062909627
##
include/nuttx/semaphore.h:
##
@@ -45,23 +45,42 @@
/* semcount, flags, waitlist, hhead */
#define NXSEM_INITIALIZER(c, f) \
- {(c), (f), SEM_WAITLIST_I
xiaoxiang781216 commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2061222786
##
sched/semaphore/sem_recover.c:
##
@@ -104,7 +105,23 @@ void nxsem_recover(FAR struct tcb_s *tcb)
* place.
*/
- atomic_fetch_add(NXSEM_
xiaoxiang781216 commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2061217016
##
sched/semaphore/sem_holder.c:
##
@@ -876,7 +876,9 @@ void nxsem_canceled(FAR struct tcb_s *stcb, FAR sem_t *sem)
{
/* Check our assumptions */
- DEBUG
xiaoxiang781216 commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2061353160
##
libs/libc/semaphore/sem_trywait.c:
##
@@ -128,8 +129,9 @@ int nxsem_trywait(FAR sem_t *sem)
#endif
)
{
- int32_t old = 1;
- return ato
xiaoxiang781216 commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2061338927
##
libs/libc/misc/lib_mutex.c:
##
@@ -195,9 +140,11 @@ bool nxmutex_is_hold(FAR mutex_t *mutex)
*
**
xiaoxiang781216 commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2061340132
##
include/nuttx/semaphore.h:
##
@@ -45,23 +45,42 @@
/* semcount, flags, waitlist, hhead */
#define NXSEM_INITIALIZER(c, f) \
- {(c), (f), SEM_WAI
xiaoxiang781216 commented on PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#issuecomment-2832245430
> @xiaoxiang781216 I disagree on your request for removing the const in many
places. what is the reason why you want that? it just tells both the compiler
and reader that the valu
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2061257154
##
sched/semaphore/sem_post.c:
##
@@ -73,10 +73,12 @@ int nxsem_post_slow(FAR sem_t *sem)
{
FAR struct tcb_s *stcb = NULL;
irqstate_t flags;
- int32_t sem_coun
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2061255959
##
libs/libc/semaphore/sem_trywait.c:
##
@@ -128,8 +129,9 @@ int nxsem_trywait(FAR sem_t *sem)
#endif
)
{
- int32_t old = 1;
- return atomic_try
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2061256889
##
libs/libc/semaphore/sem_wait.c:
##
@@ -156,8 +157,9 @@ int nxsem_wait(FAR sem_t *sem)
# endif
)
{
- int32_t old = 1;
- if (atomic_try_cmpxch
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2061256667
##
include/nuttx/semaphore.h:
##
@@ -45,23 +45,42 @@
/* semcount, flags, waitlist, hhead */
#define NXSEM_INITIALIZER(c, f) \
- {(c), (f), SEM_WAITLIST_I
jlaitine commented on PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#issuecomment-2832026530
@xiaoxiang781216 I disagree on your request for removing the const in many
places. what is the reason why you want that? it just tells both the compiler
and reader that the value is not
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2061257731
##
libs/libc/misc/lib_mutex.c:
##
@@ -195,9 +140,11 @@ bool nxmutex_is_hold(FAR mutex_t *mutex)
*
*
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2061257020
##
sched/semaphore/sem_destroy.c:
##
@@ -61,6 +61,9 @@
int nxsem_destroy(FAR sem_t *sem)
{
int32_t old;
+ const bool mutex = NXSEM_IS_MUTEX(sem);
Review Comment
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2061256810
##
include/nuttx/semaphore.h:
##
@@ -45,23 +45,42 @@
/* semcount, flags, waitlist, hhead */
#define NXSEM_INITIALIZER(c, f) \
- {(c), (f), SEM_WAITLIST_I
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2061256356
##
include/nuttx/semaphore.h:
##
@@ -45,23 +45,42 @@
/* semcount, flags, waitlist, hhead */
#define NXSEM_INITIALIZER(c, f) \
- {(c), (f), SEM_WAITLIST_I
xiaoxiang781216 commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2061204544
##
include/nuttx/semaphore.h:
##
@@ -45,23 +45,42 @@
/* semcount, flags, waitlist, hhead */
#define NXSEM_INITIALIZER(c, f) \
- {(c), (f), SEM_WAI
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2060240413
##
sched/semaphore/sem_recover.c:
##
@@ -100,7 +101,39 @@ void nxsem_recover(FAR struct tcb_s *tcb)
* place.
*/
- atomic_fetch_add(NXSEM_COUNT(s
pussuw commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2060189145
##
sched/semaphore/sem_recover.c:
##
@@ -100,7 +101,39 @@ void nxsem_recover(FAR struct tcb_s *tcb)
* place.
*/
- atomic_fetch_add(NXSEM_COUNT(sem
pussuw commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2060189145
##
sched/semaphore/sem_recover.c:
##
@@ -100,7 +101,39 @@ void nxsem_recover(FAR struct tcb_s *tcb)
* place.
*/
- atomic_fetch_add(NXSEM_COUNT(sem
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2060173828
##
sched/semaphore/sem_recover.c:
##
@@ -100,7 +101,39 @@ void nxsem_recover(FAR struct tcb_s *tcb)
* place.
*/
- atomic_fetch_add(NXSEM_COUNT(s
pussuw commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2060137404
##
sched/semaphore/sem_recover.c:
##
@@ -100,7 +101,39 @@ void nxsem_recover(FAR struct tcb_s *tcb)
* place.
*/
- atomic_fetch_add(NXSEM_COUNT(sem
pussuw commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2060138277
##
sched/semaphore/sem_recover.c:
##
@@ -100,7 +101,39 @@ void nxsem_recover(FAR struct tcb_s *tcb)
* place.
*/
- atomic_fetch_add(NXSEM_COUNT(sem
pussuw commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2060137404
##
sched/semaphore/sem_recover.c:
##
@@ -100,7 +101,39 @@ void nxsem_recover(FAR struct tcb_s *tcb)
* place.
*/
- atomic_fetch_add(NXSEM_COUNT(sem
pussuw commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2060112180
##
sched/semaphore/sem_post.c:
##
@@ -85,19 +87,54 @@ int nxsem_post_slow(FAR sem_t *sem)
flags = enter_critical_section();
- /* Check the maximum allowable valu
pussuw commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2060111412
##
sched/semaphore/sem_recover.c:
##
@@ -86,7 +86,8 @@ void nxsem_recover(FAR struct tcb_s *tcb)
if (tcb->task_state == TSTATE_WAIT_SEM)
{
FAR sem_t *sem
jlaitine commented on PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#issuecomment-2829681915
@pussuw I now modified the nxsem_reset for mutex somewhat acc. to your
feedback, and re-tested that it works for me. Please re-check that part!
--
This is an automated message from the
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2059578589
##
sched/semaphore/sem_wait.c:
##
@@ -218,6 +271,16 @@ int nxsem_wait_slow(FAR sem_t *sem)
#endif
}
+ /* If this now holds the mutex, set the holder TID and t
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2059591043
##
sched/semaphore/sem_post.c:
##
@@ -85,19 +87,54 @@ int nxsem_post_slow(FAR sem_t *sem)
flags = enter_critical_section();
- /* Check the maximum allowable va
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2059578589
##
sched/semaphore/sem_wait.c:
##
@@ -218,6 +271,16 @@ int nxsem_wait_slow(FAR sem_t *sem)
#endif
}
+ /* If this now holds the mutex, set the holder TID and t
jlaitine commented on code in PR #16194:
URL: https://github.com/apache/nuttx/pull/16194#discussion_r2059569009
##
libs/libc/semaphore/sem_init.c:
##
@@ -62,15 +62,15 @@
*
/
-int nxsem_init(FAR sem
1 - 100 of 211 matches
Mail list logo