PThreads.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2002, Log4cpp Project. All rights reserved.
3  *
4  * See the COPYING file for the terms of usage and distribution.
5  */
6 
8 
9 #if defined(LOG4CPP_HAVE_THREADING) && defined(LOG4CPP_USE_PTHREADS)
10 
11 namespace log4cpp {
12  namespace threading {
13 
14  char* getThreadId(char* buffer) {
15  ::sprintf(buffer, "%lu", (long int)pthread_self());
16  return buffer;
17  }
18 
19  std::string getThreadId() {
20  char buffer[16];
21  ::sprintf(buffer, "%lu", pthread_self()); // thread id unsigned
22  return std::string(buffer);
23  }
24 
25  }
26 }
27 
28 #endif // LOG4CPP_HAVE_THREADING && LOG4CPP_USE_PTHREADS
static std::string getThreadId()
Definition: BoostThreads.hh:22


log4cpp
Author(s): Stephen Roderick, Bastiaan Bakker, Cedric Le Goater, Steve Ostlind, Marcel Harkema, Walter Stroebel, Glenn Scott and Tony Cheung
autogenerated on Sun Jun 23 2019 19:14:17