You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/06/24 10:23:14 UTC

[GitHub] [incubator-nuttx] anchao opened a new pull request #1292: pthread/mutex: add PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP support

anchao opened a new pull request #1292:
URL: https://github.com/apache/incubator-nuttx/pull/1292


   ## Summary
   pthread/mutex: add PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP support
   
   ## Impact
   
   ## Testing
   
   `pthread_mutex_t mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;`
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [incubator-nuttx] acassis merged pull request #1292: pthread/mutex: add PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP support

Posted by GitBox <gi...@apache.org>.
acassis merged pull request #1292:
URL: https://github.com/apache/incubator-nuttx/pull/1292


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [incubator-nuttx] davids5 commented on a change in pull request #1292: pthread/mutex: add PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP support

Posted by GitBox <gi...@apache.org>.
davids5 commented on a change in pull request #1292:
URL: https://github.com/apache/incubator-nuttx/pull/1292#discussion_r444797530



##########
File path: include/pthread.h
##########
@@ -344,9 +344,16 @@ typedef struct pthread_mutex_s pthread_mutex_t;
 #  define PTHREAD_MUTEX_INITIALIZER {NULL, SEM_INITIALIZER(1), -1, \
                                      __PTHREAD_MUTEX_DEFAULT_FLAGS, \
                                      PTHREAD_MUTEX_DEFAULT, 0}
+#  define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
+                                     {NULL, SEM_INITIALIZER(1), -1, \
+                                     __PTHREAD_MUTEX_DEFAULT_FLAGS, \
+                                     PTHREAD_MUTEX_RECURSIVE, 0}
 #elif defined(CONFIG_PTHREAD_MUTEX_TYPES)
 #  define PTHREAD_MUTEX_INITIALIZER {SEM_INITIALIZER(1), -1, \
                                      PTHREAD_MUTEX_DEFAULT, 0}
+#  define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \

Review comment:
       Why 2 Times? What is NP?  How about a comment.  // nonportable
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [incubator-nuttx] davids5 commented on a change in pull request #1292: pthread/mutex: add PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP support

Posted by GitBox <gi...@apache.org>.
davids5 commented on a change in pull request #1292:
URL: https://github.com/apache/incubator-nuttx/pull/1292#discussion_r444812475



##########
File path: include/pthread.h
##########
@@ -344,9 +344,16 @@ typedef struct pthread_mutex_s pthread_mutex_t;
 #  define PTHREAD_MUTEX_INITIALIZER {NULL, SEM_INITIALIZER(1), -1, \
                                      __PTHREAD_MUTEX_DEFAULT_FLAGS, \
                                      PTHREAD_MUTEX_DEFAULT, 0}
+#  define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
+                                     {NULL, SEM_INITIALIZER(1), -1, \
+                                     __PTHREAD_MUTEX_DEFAULT_FLAGS, \
+                                     PTHREAD_MUTEX_RECURSIVE, 0}
 #elif defined(CONFIG_PTHREAD_MUTEX_TYPES)
 #  define PTHREAD_MUTEX_INITIALIZER {SEM_INITIALIZER(1), -1, \
                                      PTHREAD_MUTEX_DEFAULT, 0}
+#  define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \

Review comment:
       Thanks @anchao - imissed the #elsif :)  I realize this is not part of the this change....but I wonder if the #if defing should nested not compound for better readability.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [incubator-nuttx] anchao commented on a change in pull request #1292: pthread/mutex: add PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP support

Posted by GitBox <gi...@apache.org>.
anchao commented on a change in pull request #1292:
URL: https://github.com/apache/incubator-nuttx/pull/1292#discussion_r444804424



##########
File path: include/pthread.h
##########
@@ -344,9 +344,16 @@ typedef struct pthread_mutex_s pthread_mutex_t;
 #  define PTHREAD_MUTEX_INITIALIZER {NULL, SEM_INITIALIZER(1), -1, \
                                      __PTHREAD_MUTEX_DEFAULT_FLAGS, \
                                      PTHREAD_MUTEX_DEFAULT, 0}
+#  define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
+                                     {NULL, SEM_INITIALIZER(1), -1, \
+                                     __PTHREAD_MUTEX_DEFAULT_FLAGS, \
+                                     PTHREAD_MUTEX_RECURSIVE, 0}
 #elif defined(CONFIG_PTHREAD_MUTEX_TYPES)
 #  define PTHREAD_MUTEX_INITIALIZER {SEM_INITIALIZER(1), -1, \
                                      PTHREAD_MUTEX_DEFAULT, 0}
+#  define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \

Review comment:
       >> Why 2 Times? 
   thread safe and unsafe version
   
   >> What is NP? How about a comment. // nonportable
   Ok
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [incubator-nuttx] anchao commented on a change in pull request #1292: pthread/mutex: add PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP support

Posted by GitBox <gi...@apache.org>.
anchao commented on a change in pull request #1292:
URL: https://github.com/apache/incubator-nuttx/pull/1292#discussion_r444807843



##########
File path: include/pthread.h
##########
@@ -344,9 +344,16 @@ typedef struct pthread_mutex_s pthread_mutex_t;
 #  define PTHREAD_MUTEX_INITIALIZER {NULL, SEM_INITIALIZER(1), -1, \
                                      __PTHREAD_MUTEX_DEFAULT_FLAGS, \
                                      PTHREAD_MUTEX_DEFAULT, 0}
+#  define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
+                                     {NULL, SEM_INITIALIZER(1), -1, \
+                                     __PTHREAD_MUTEX_DEFAULT_FLAGS, \
+                                     PTHREAD_MUTEX_RECURSIVE, 0}
 #elif defined(CONFIG_PTHREAD_MUTEX_TYPES)
 #  define PTHREAD_MUTEX_INITIALIZER {SEM_INITIALIZER(1), -1, \
                                      PTHREAD_MUTEX_DEFAULT, 0}
+#  define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \

Review comment:
       I added some comment of _NP in the commit message and Summary.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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