projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Replace uses of the URCU tls helpers by the standard thread_local
[lttng-tools.git]
/
src
/
common
/
error.cpp
diff --git
a/src/common/error.cpp
b/src/common/error.cpp
index cafb15f92948b8ee209fae25422ff9459a6da382..6bf1e30f09274e6b7215bd6b6cde9151ffb0c646 100644
(file)
--- a/
src/common/error.cpp
+++ b/
src/common/error.cpp
@@
-29,10
+29,10
@@
namespace {
int lttng_opt_abort_on_error = -1;
/* TLS variable that contains the time of one single log entry. */
int lttng_opt_abort_on_error = -1;
/* TLS variable that contains the time of one single log entry. */
-
DEFINE_URCU_TLS(struct log_time, error_log_time)
;
+
thread_local struct log_time error_log_time
;
} /* namespace */
} /* namespace */
-
DEFINE_URCU_TLS(const char *, logger_thread_name)
;
+
thread_local const char * logger_thread_name
;
const char *log_add_time()
{
const char *log_add_time()
{
@@
-54,8
+54,8
@@
const char *log_add_time()
}
/* Format time in the TLS variable. */
}
/* Format time in the TLS variable. */
- ret = snprintf(
URCU_TLS(error_log_time)
.str,
- sizeof(
URCU_TLS(error_log_time)
.str),
+ ret = snprintf(
error_log_time
.str,
+ sizeof(
error_log_time
.str),
"%02d:%02d:%02d.%09ld",
tm.tm_hour,
tm.tm_min,
"%02d:%02d:%02d.%09ld",
tm.tm_hour,
tm.tm_min,
@@
-66,7
+66,7
@@
const char *log_add_time()
}
errno = errsv;
}
errno = errsv;
- return
URCU_TLS(error_log_time)
.str;
+ return
error_log_time
.str;
error:
/* Return an empty string on error so logging is not affected. */
error:
/* Return an empty string on error so logging is not affected. */
@@
-79,7
+79,7
@@
void logger_set_thread_name(const char *name, bool set_pthread_name)
int ret;
LTTNG_ASSERT(name);
int ret;
LTTNG_ASSERT(name);
-
URCU_TLS(logger_thread_name)
= name;
+
logger_thread_name
= name;
if (set_pthread_name) {
ret = lttng_thread_setname(name);
if (set_pthread_name) {
ret = lttng_thread_setname(name);
This page took
0.023484 seconds
and
4
git commands to generate.