Skip to content

Commit a6795aa

Browse files
author
Chrono Law
committed
pool thread task
1 parent 4bb4ba9 commit a6795aa

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

ngxpp/NgxPool.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,16 @@ class NgxPool final : public NgxWrapper<ngx_pool_t>
188188
return p;
189189
}
190190

191+
public:
192+
template<typename T>
193+
ngx_thread_task_t* thread_task() const
194+
{
195+
auto p = ngx_thread_task_alloc(get(), sizeof(T));
196+
197+
NgxException::require(p);
198+
199+
return p;
200+
}
191201
public:
192202
ngx_file_t* file() const
193203
{

0 commit comments

Comments
 (0)