Track the cpu used in the main thread by each logging context

This commit is contained in:
Mark Haines 2015-12-03 21:03:01 +00:00
parent b8680b82c3
commit 48a2526d62
3 changed files with 72 additions and 10 deletions

View file

@ -30,8 +30,7 @@ def debug_deferreds():
context = LoggingContext.current_context()
def restore_context_callback(x):
with PreserveLoggingContext():
LoggingContext.thread_local.current_context = context
with PreserveLoggingContext(context):
return fn(x)
return restore_context_callback