You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/11/29 13:05:19 UTC

[GitHub] utzig commented on a change in pull request #1539: spiflash: Make spiflash thread safe

utzig commented on a change in pull request #1539: spiflash: Make spiflash thread safe
URL: https://github.com/apache/mynewt-core/pull/1539#discussion_r237478006
 
 

 ##########
 File path: hw/drivers/flash/spiflash/src/spiflash.c
 ##########
 @@ -748,6 +794,8 @@ spiflash_read(const struct hal_flash *hal_flash_dev, uint32_t addr, void *buf,
 
     dev = (struct spiflash_dev *)hal_flash_dev;
 
+    spiflash_lock(dev);
+
     err = spiflash_wait_ready(dev, 100);
 
 Review comment:
   Just do be sure, you are locking just above and again inside `spiflash_wait_ready`. I never remember the semantics of these mutexes but does this not cause a deadlock?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services