Added missing assert to the thread_pool object

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402637
This commit is contained in:
Davis King 2008-11-07 00:04:51 +00:00
parent 65c4e4a970
commit e1a0626b83
1 changed files with 7 additions and 0 deletions

View File

@ -18,6 +18,13 @@ namespace dlib
task_ready_signaler(m), task_ready_signaler(m),
we_are_destructing(false) we_are_destructing(false)
{ {
// make sure requires clause is not broken
DLIB_ASSERT(num_threads > 0,
"\tthread_pool::thread_pool()"
<< "\n\tthe number of threads in a thread_pool can't be zero"
<< "\n\tthis: " << this
);
tasks.expand(num_threads); tasks.expand(num_threads);
for (unsigned long i = 0; i < num_threads; ++i) for (unsigned long i = 0; i < num_threads; ++i)
{ {