pkarashchenko commented on code in PR #7597:
URL: https://github.com/apache/incubator-nuttx/pull/7597#discussion_r1022423652


##########
fs/procfs/fs_procfsproc.c:
##########
@@ -1484,7 +1484,7 @@ static int proc_open(FAR struct file *filep, FAR const 
char *relpath,
 
   if (strncmp(relpath, "self", 4) == 0)
     {
-      tmp = (unsigned long)getpid();    /* Get the PID of the calling task */
+      tmp = (unsigned long)gettid();    /* Get the PID of the calling task */

Review Comment:
   ```suggestion
         tmp = gettid();    /* Get the TID of the calling task */
   ```
   



##########
sched/pthread/pthread_mutexunlock.c:
##########
@@ -142,15 +142,15 @@ int pthread_mutex_unlock(FAR pthread_mutex_t *mutex)
        * thread owns the semaphore.
        */
 
-      if (mutex->pid != (int)getpid())
+      if (mutex->pid != (int)gettid())
 
 #elif defined(CONFIG_PTHREAD_MUTEX_UNSAFE) && 
defined(CONFIG_PTHREAD_MUTEX_TYPES)
       /* If mutex types are not supported, then all mutexes are NORMAL (or
        * DEFAULT).  Error checking should never be performed for the
        * non-robust NORMAL mutex type.
        */
 
-      if (mutex->type != PTHREAD_MUTEX_NORMAL && mutex->pid != (int)getpid())
+      if (mutex->type != PTHREAD_MUTEX_NORMAL && mutex->pid != (int)gettid())

Review Comment:
   ```suggestion
         if (mutex->type != PTHREAD_MUTEX_NORMAL && mutex->pid != gettid())
   ```
   



##########
drivers/syslog/vsyslog.c:
##########
@@ -157,7 +157,7 @@ int nx_vsyslog(int priority, FAR const IPTR char *fmt, FAR 
va_list *ap)
 #if defined(CONFIG_SYSLOG_PROCESSID)
   /* Prepend the Process ID */
 
-  ret += lib_sprintf(&stream.public, "[%2d] ", (int)getpid());
+  ret += lib_sprintf(&stream.public, "[%2d] ", (int)gettid());

Review Comment:
   ```suggestion
     ret += lib_sprintf(&stream.public, "[%2d] ", gettid());
   ```
   



##########
sched/pthread/pthread_condwait.c:
##########
@@ -74,7 +74,7 @@ int pthread_cond_wait(FAR pthread_cond_t *cond, FAR 
pthread_mutex_t *mutex)
 
   /* Make sure that the caller holds the mutex */
 
-  else if (mutex->pid != (int)getpid())
+  else if (mutex->pid != (int)gettid())

Review Comment:
   ```suggestion
     else if (mutex->pid != gettid())
   ```
   



##########
sched/pthread/pthread_mutexunlock.c:
##########
@@ -164,7 +164,7 @@ int pthread_mutex_unlock(FAR pthread_mutex_t *mutex)
        * the EPERM error?
        */
 
-      if (errcheck && mutex->pid != (int)getpid())
+      if (errcheck && mutex->pid != (int)gettid())

Review Comment:
   ```suggestion
         if (errcheck && mutex->pid != gettid())
   ```
   



##########
sched/pthread/pthread_mutexunlock.c:
##########
@@ -142,15 +142,15 @@ int pthread_mutex_unlock(FAR pthread_mutex_t *mutex)
        * thread owns the semaphore.
        */
 
-      if (mutex->pid != (int)getpid())
+      if (mutex->pid != (int)gettid())

Review Comment:
   ```suggestion
         if (mutex->pid != gettid())
   ```
   



##########
fs/procfs/fs_procfsproc.c:
##########
@@ -2032,7 +2032,7 @@ static int proc_stat(const char *relpath, struct stat 
*buf)
 
   if (strncmp(relpath, "self", 4) == 0)
     {
-      tmp = (unsigned long)getpid();    /* Get the PID of the calling task */
+      tmp = (unsigned long)gettid();    /* Get the PID of the calling task */

Review Comment:
   ```suggestion
         tmp = gettid();    /* Get the TID of the calling task */
   ```
   



##########
fs/procfs/fs_procfsproc.c:
##########
@@ -1792,7 +1792,7 @@ static int proc_opendir(FAR const char *relpath,
 
   if (strncmp(relpath, "self", 4) == 0)
     {
-      tmp = (unsigned long)getpid();    /* Get the PID of the calling task */
+      tmp = (unsigned long)gettid();    /* Get the PID of the calling task */

Review Comment:
   ```suggestion
         tmp = gettid();    /* Get the TID of the calling task */
   ```
   



-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to