From 00d1465d13980fc3acf650f182ee0723fbda0e06 Mon Sep 17 00:00:00 2001 From: Michael Bebenita Date: Mon, 19 Jul 2010 14:05:18 -0700 Subject: Added a message passing system based on lock free queues for inter-thread communication. Channels now buffer on the sending side, and no longer require blocking when sending. Lots of other refactoring and bug fixes. --- src/rt/rust_log.h | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'src/rt/rust_log.h') diff --git a/src/rt/rust_log.h b/src/rt/rust_log.h index bd32c155..06712066 100644 --- a/src/rt/rust_log.h +++ b/src/rt/rust_log.h @@ -1,22 +1,18 @@ -#ifndef RUST_LOG_H_ -#define RUST_LOG_H_ +#ifndef RUST_LOG_H +#define RUST_LOG_H class rust_dom; +class rust_task; + + class rust_log { - rust_srv *_srv; - rust_dom *_dom; - uint32_t _type_bit_mask; - bool _use_colors; - uint32_t _indent; - void trace_ln(char *message); + public: rust_log(rust_srv *srv, rust_dom *dom); virtual ~rust_log(); enum ansi_color { - BLACK, - GRAY, WHITE, RED, LIGHTRED, @@ -51,10 +47,19 @@ public: void indent(); void outdent(); void reset_indent(uint32_t indent); - void trace_ln(uint32_t type_bits, char *message); - void trace_ln(ansi_color color, uint32_t type_bits, char *message); + void trace_ln(char *prefix, char *message); + void trace_ln(rust_task *task, uint32_t type_bits, char *message); + void trace_ln(rust_task *task, ansi_color color, uint32_t type_bits, char *message); bool is_tracing(uint32_t type_bits); - static ansi_color get_type_color(log_type type); + +private: + rust_srv *_srv; + rust_dom *_dom; + uint32_t _type_bit_mask; + bool _use_labels; + bool _use_colors; + uint32_t _indent; + void trace_ln(rust_task *task, char *message); }; -#endif /* RUST_LOG_H_ */ +#endif /* RUST_LOG_H */ -- cgit v1.2.3