Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- wait notification, tpool_wait_begin/tpool_wait_end - to notify the threadpool that current thread is going to wait Use it to wait for IOs to complete and also when purge waits for workers.
- Loading branch information
Showing
7 changed files
with
118 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include <tpool.h> | ||
|
||
static thread_local tpool::thread_pool* tls_thread_pool; | ||
|
||
extern "C" void set_tls_pool(tpool::thread_pool* pool) | ||
{ | ||
tls_thread_pool = pool; | ||
} | ||
|
||
extern "C" void tpool_wait_begin() | ||
{ | ||
if (tls_thread_pool) | ||
tls_thread_pool->wait_begin(); | ||
} | ||
|
||
|
||
extern "C" void tpool_wait_end() | ||
{ | ||
if (tls_thread_pool) | ||
tls_thread_pool->wait_end(); | ||
} |