freertos: Refactor stream buffer spinlock initialization

This commit refactors the way stream buffers initialize their spinlock.

- "prvInitialiseNewStreamBuffer()" now initializes the stream buffer fields
  manually (instead of using memset()) to avoid resetting the spin lock
- Stream buffer creation functions now manually initialize the spinlock after
  the other fields are initialized using "prvInitialiseNewStreamBuffer()"

Also added comments to event group spinlock initializtion.
This commit is contained in:
Darian Leung
2022-11-01 23:11:48 +08:00
parent cea5813360
commit 40b96cf596
2 changed files with 31 additions and 76 deletions

View File

@@ -136,10 +136,10 @@ static BaseType_t prvTestWaitCondition( const EventBits_t uxCurrentEventBits,
}
#endif /* configSUPPORT_DYNAMIC_ALLOCATION */
traceEVENT_GROUP_CREATE( pxEventBits );
#ifdef ESP_PLATFORM
/* Initialize the event group's spinlock. */
portMUX_INITIALIZE( &pxEventBits->xEventGroupLock );
#endif // ESP_PLATFORM
traceEVENT_GROUP_CREATE( pxEventBits );
}
else
{
@@ -190,9 +190,8 @@ static BaseType_t prvTestWaitCondition( const EventBits_t uxCurrentEventBits,
}
#endif /* configSUPPORT_STATIC_ALLOCATION */
#ifdef ESP_PLATFORM
/* Initialize the event group's spinlock. */
portMUX_INITIALIZE( &pxEventBits->xEventGroupLock );
#endif // ESP_PLATFORM
traceEVENT_GROUP_CREATE( pxEventBits );
}