~zooko/cryptopp/trunk

« back to all changes in this revision

Viewing changes to wait.cpp

  • Committer: weidai
  • Date: 2006-12-09 17:18:13 UTC
  • Revision ID: svn-v4:57ff6487-cd31-0410-9ec3-f628ee90f5f0:trunk/c5:247
add Salsa20 cipher

Show diffs side-by-side

added added

removed removed

Lines of Context:
236
236
        {
237
237
                // too many wait objects for a single WaitForMultipleObjects call, so use multiple threads
238
238
                static const unsigned int WAIT_OBJECTS_PER_THREAD = MAXIMUM_WAIT_OBJECTS-1;
239
 
                unsigned int nThreads = (unsigned int)((m_handles.size() + WAIT_OBJECTS_PER_THREAD - 1) / WAIT_OBJECTS_PER_THREAD);
 
239
                unsigned int nThreads = unsigned int((m_handles.size() + WAIT_OBJECTS_PER_THREAD - 1) / WAIT_OBJECTS_PER_THREAD);
240
240
                if (nThreads > MAXIMUM_WAIT_OBJECTS)    // still too many wait objects, maybe implement recursive threading later?
241
241
                        throw Err("WaitObjectContainer: number of wait objects exceeds limit");
242
242
                CreateThreads(nThreads);
250
250
                        if (i<nThreads)
251
251
                        {
252
252
                                thread.waitHandles = &m_handles[i*WAIT_OBJECTS_PER_THREAD];
253
 
                                thread.count = UnsignedMin(WAIT_OBJECTS_PER_THREAD, m_handles.size() - i*WAIT_OBJECTS_PER_THREAD);
 
253
                                thread.count = STDMIN(WAIT_OBJECTS_PER_THREAD, (unsigned int)(m_handles.size() - i*WAIT_OBJECTS_PER_THREAD));
254
254
                                thread.error = &error;
255
255
                        }
256
256
                        else