aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-05-09 14:51:50 +0200
committerFlorian Dold <florian.dold@gmail.com>2019-05-09 14:54:00 +0200
commit67c3314628930be7e6a9d224456c8dac0f4c8fd4 (patch)
tree6d4a141ee37d13aaea3435a1621ca4e323b7ff3f /src/util
parent95096540e381d784ab0d28b6cde2935b9b269558 (diff)
downloadgnunet-67c3314628930be7e6a9d224456c8dac0f4c8fd4.tar.gz
gnunet-67c3314628930be7e6a9d224456c8dac0f4c8fd4.zip
towards thread-safe logging
(Thread-safe logging isn't really relevant for GNUnet itself, but it is necessary for the GNU Taler exchange)
Diffstat (limited to 'src/util')
-rw-r--r--src/util/common_logging.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/util/common_logging.c b/src/util/common_logging.c
index de30cab3a..34002e0fc 100644
--- a/src/util/common_logging.c
+++ b/src/util/common_logging.c
@@ -100,27 +100,27 @@ struct CustomLogger
100 * Note that this message maybe truncated to the first BULK_TRACK_SIZE 100 * Note that this message maybe truncated to the first BULK_TRACK_SIZE
101 * characters, in which case it is NOT 0-terminated! 101 * characters, in which case it is NOT 0-terminated!
102 */ 102 */
103static char last_bulk[BULK_TRACK_SIZE] __attribute__ ((nonstring)); 103static GNUNET_THREAD_LOCAL char last_bulk[BULK_TRACK_SIZE] __attribute__ ((nonstring));
104 104
105/** 105/**
106 * Type of the last bulk message. 106 * Type of the last bulk message.
107 */ 107 */
108static enum GNUNET_ErrorType last_bulk_kind; 108static GNUNET_THREAD_LOCAL enum GNUNET_ErrorType last_bulk_kind;
109 109
110/** 110/**
111 * Time of the last bulk error message (0 for none) 111 * Time of the last bulk error message (0 for none)
112 */ 112 */
113static struct GNUNET_TIME_Absolute last_bulk_time; 113static GNUNET_THREAD_LOCAL struct GNUNET_TIME_Absolute last_bulk_time;
114 114
115/** 115/**
116 * Number of times that bulk message has been repeated since. 116 * Number of times that bulk message has been repeated since.
117 */ 117 */
118static unsigned int last_bulk_repeat; 118static GNUNET_THREAD_LOCAL unsigned int last_bulk_repeat;
119 119
120/** 120/**
121 * Component when the last bulk was logged. Will be 0-terminated. 121 * Component when the last bulk was logged. Will be 0-terminated.
122 */ 122 */
123static char last_bulk_comp[COMP_TRACK_SIZE + 1]; 123static GNUNET_THREAD_LOCAL char last_bulk_comp[COMP_TRACK_SIZE + 1];
124 124
125/** 125/**
126 * Running component. 126 * Running component.
@@ -150,7 +150,7 @@ static struct CustomLogger *loggers;
150/** 150/**
151 * Number of log calls to ignore. 151 * Number of log calls to ignore.
152 */ 152 */
153static int skip_log = 0; 153static GNUNET_THREAD_LOCAL int skip_log = 0;
154 154
155/** 155/**
156 * File descriptor to use for "stderr", or NULL for none. 156 * File descriptor to use for "stderr", or NULL for none.