Skip to content

Commit

Permalink
Allow public access to the internal worker-thread object
Browse files Browse the repository at this point in the history
  • Loading branch information
mattiasflodin committed May 22, 2016
1 parent 148b9d9 commit c623d55
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions doc/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ public:
void panic_flush();

std::thread& worker_thread();

protected:
template <class Formatter, typename... Args>
void write(Args&&... args);
Expand Down Expand Up @@ -125,6 +127,13 @@ after the call. The log object is left in a "panic" state that prevents any
cleanup in the destructor. Any thread that tries to write to the log after this
will be suspended.</td></tr>
<tr><td><code>worker_thread</code></td>
<td>Provide access to the internal worker-thread object. The intent is to allow
platform-specific manipulation of the thread, such as setting priority or
affinity. Use good judgement when accessing this object, as any destructive
action such as moving or detaching it can cause reckless to
malfunction.</td></tr>
<tr><td><code>write</code></td>
<td>Store <code>args</code> on the asynchronous queue and invoke the static
function <code>Formatter::format(output_buffer*, Args...)</code> from the
Expand Down
8 changes: 8 additions & 0 deletions reckless/include/reckless/basic_log.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@ class basic_log : private output_buffer {

void panic_flush();

// Provide access to the internal worker-thread object. The intent is to
// allow platform-specific manipulation of the thread, such as setting
// priority or affinity.
std::thread& worker_thread()
{
return output_thread_;
}

protected:
template <class Formatter, typename... Args>
void write(Args&&... args)
Expand Down

0 comments on commit c623d55

Please sign in to comment.