[PATCH rtems6 - v1 06/16] Flashdev: Make mutex name more generic

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Jan 8 13:13:51 UTC 2024


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.

-- 
embedded brains GmbH & Co. KG
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber at embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/


More information about the devel mailing list