diff options
| author | toddaaro <github@opprobrio.us> | 2013-07-19 14:25:05 -0700 |
|---|---|---|
| committer | toddaaro <github@opprobrio.us> | 2013-08-01 15:14:00 -0700 |
| commit | f7eed223873a4280c9abea937e60ef1aaedf0162 (patch) | |
| tree | d1dea92a84b12741e7796cf91938edbae906fd8e /src/libstd/macros.rs | |
| parent | 82b24559e6aa0914f8a49e0a9dbfb3cf35372515 (diff) | |
| download | rust-f7eed223873a4280c9abea937e60ef1aaedf0162.tar.gz rust-f7eed223873a4280c9abea937e60ef1aaedf0162.zip | |
A major refactoring that changes the way the runtime uses TLS. In the
old design the TLS held the scheduler struct, and the scheduler struct held the active task. This posed all sorts of weird problems due to how we wanted to use the contents of TLS. The cleaner approach is to leave the active task in TLS and have the task hold the scheduler. To make this work out the scheduler has to run inside a regular task, and then once that is the case the context switching code is massively simplified, as instead of three possible paths there is only one. The logical flow is also easier to follow, as the scheduler struct acts somewhat like a "token" indicating what is active. These changes also necessitated changing a large number of runtime tests, and rewriting most of the runtime testing helpers. Polish level is "low", as I will very soon start on more scheduler changes that will require wiping the polish off. That being said there should be sufficient comments around anything complex to make this entirely respectable as a standalone commit.
Diffstat (limited to 'src/libstd/macros.rs')
| -rw-r--r-- | src/libstd/macros.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs index 7748c43efcd..04058887970 100644 --- a/src/libstd/macros.rs +++ b/src/libstd/macros.rs @@ -23,9 +23,14 @@ macro_rules! rtdebug_ ( } ) ) -// An alternate version with no output, for turning off logging +// An alternate version with no output, for turning off logging. An +// earlier attempt that did not call the fmt! macro was insufficient, +// as a case of the "let bind each variable" approach eventually +// failed without an error message describing the invocation site. macro_rules! rtdebug ( - ($( $arg:expr),+) => ( $(let _ = $arg)*; ) + ($( $arg:expr),+) => ( { + let _x = fmt!( $($arg),+ ); + }) ) macro_rules! rtassert ( |
