[PATCH rtems6 - v1 06/16] Flashdev: Make mutex name more generic
Kinsey Moore
kinsey.moore at oarcorp.com
Mon Jan 8 19:34:53 UTC 2024
On Mon, Jan 8, 2024 at 7:13 AM Sebastian Huber <
sebastian.huber at embedded-brains.de> wrote:
> On 04.01.24 19:34, berndmoessner80 at gmail.com wrote:
> > @@ -490,7 +491,9 @@ static int rtems_flashdev_do_init(
> > void ( *destroy )( rtems_flashdev *flash )
> > )
> > {
> > - rtems_recursive_mutex_init( &flash->mutex, "RTEMS_FLASHDEV Flash" );
> > + char mtx_name[19];
> > + sprintf(mtx_name, "FDEV_MTX_%08x", (unsigned int) flash);
> > + rtems_recursive_mutex_init( &flash->mutex, (const char*) &mtx_name);
>
> The mutex name must exist throughout the life-time of the mutex object.
> So, here you can't use a name on a thread stack.
>
This was fixed in a later patch in the set and appears to have been dropped
entirely from the v2 patch set.
Kinsey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20240108/86d7d0a3/attachment.htm>
More information about the devel
mailing list