Print

Print


URL:
  <http://savannah.cern.ch/bugs/?91666>

                 Summary: XrdSysThread::Num() does not distinguish between
threads
                 Project: XROOTD
            Submitted by: dhsmith
            Submitted on: 2012-02-17 20:43
                Severity: 3 - Normal
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
      Fixed by commit(s): 

    _______________________________________________________

Details:

I find (with my xroot builds from git) that, XrdSysThread::Num() is returning
the PID, which is the same for all threads in the xrootd process.

From XrdSysPthread.cc the first block of these ifdefs is used:

#if   defined(__linux__)
   myNum = static_cast<unsigned int>(getpid());
#elif defined(__solaris__)
   myNum = static_cast<unsigned int>(pthread_self());
#elif defined(__macos__)
   myNum = static_cast<unsigned
int>(pthread_mach_thread_np(pthread_self()));
#else
   static XrdSysMutex   numMutex;
   static unsigned long threadNum = 1;
   numMutex.Lock(); threadNum++; myNum = threadNum; numMutex.UnLock();
#endif

I think the intention was that XrdSysThread::Num() would distinguish between
threads. (Or at least I believe this would add useful information to the
log).




    _______________________________________________________

Reply to this item at:

  <http://savannah.cern.ch/bugs/?91666>

_______________________________________________
  Message sent via/by LCG Savannah
  http://savannah.cern.ch/

########################################################################
Use REPLY-ALL to reply to list

To unsubscribe from the XROOTD-DEV list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-DEV&A=1