[riot-notifications] [RIOT-OS/RIOT] core/rmutex: use atomic utils (#16919)

Marian Buschsieweke notifications at github.com
Thu Sep 30 11:12:26 CEST 2021


And also:

`$ make BOARD=samr21-xpro BUILD_IN_DOCKER=1 -C tests/rmutex`

`master`:

```
   text	   data	    bss	    dec	    hex	filename
  10748	    132	  10056	  20936	   51c8	/data/riotbuild/riotbase/tests/rmutex/bin/samr21-xpro/tests_rmutex.elf
```

This PR:

```
   text	   data	    bss	    dec	    hex	filename
  10792	    132	  10056	  20980	   51f4	/data/riotbuild/riotbase/tests/rmutex/bin/samr21-xpro/tests_rmutex.elf
```

So this *increases* ROM consumption for some reason. The reason is that previously relaxed memory order was used, atomic utils always use sequentially consistent memory accesses. I think this is actually fixing a race condition in the code, as otherwise the compiler could load the owner of the rmutex before checking if it is already locked.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16919#issuecomment-931105197
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210930/59c2d740/attachment.htm>


More information about the notifications mailing list