File: OmniThreads.cpp

package info (click to toggle)
log4shib 2.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 2,968 kB
  • sloc: cpp: 4,786; sh: 4,242; ansic: 818; makefile: 193
file content (16 lines) | stat: -rw-r--r-- 418 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <log4shib/threading/Threading.hh>

#if defined(LOG4SHIB_HAVE_THREADING) && defined(LOG4SHIB_USE_OMNITHREADS)

namespace log4shib {
    namespace threading {

        std::string getThreadId() {
            char buffer[16];
            sprintf(buffer, "%d", ::omni_thread::self()->id());
            return std::string(buffer);
        };
    }
}

#endif // LOG4SHIB_HAVE_THREADING && LOG4SHIB_USE_ONMITHREADS