

while (m_Jobs.size())
{
// wait for all threads to be done
if (m_Jobs.front()->Status() == CJob::STATE_DONE)
m_Jobs.pop_front();
}
return 0;






















75662b6 remove unused and not implemented IOFLAG_RANDOM, add assert - Robyt3
4a37524 fix fs_listdir and fs_listdir_fileinfo with unicode on windows - Robyt3
f6954c8 fix io_open with unicode on windows - Robyt3
355466e fix fs_is_dir with unicode on windows - Robyt3
c89cdc6 add fs_file_time - Robyt3
2171373 fix code format - Robyt3
121173b Merge #4111 - bors[bot]




8dbefa7 Editor Improvements - HamidReza585
91d7a67 Update explanations.cpp - HamidReza585
8b69ffe clang-format - HamidReza585
c9018a2 More Tiles - HamidReza585
009a951 clang-format - HamidReza585
3ca0925 New Tiles & Improvements - HamidReza585
73a21ca Fix specchar transparency and move spec-char to character snap - fokkonaut
76db1d7 Merge #4121 #4124 - bors[bot]




m_Shutdown check to Add so you can ensure no new jobs, and the previous solution I mentioned, a condition variable waiting on an atomic counter to be 0

























m_Shutdown = true;
for(int i = 0; i < m_NumThreads; i++)
sphore_signal(&m_Semaphore);
for(int i = 0; i < m_NumThreads; i++)
{
if(m_apThreads[i])
thread_wait(m_apThreads[i]);
}
lock_destroy(m_Lock);
sphore_destroy(&m_Semaphore);













for(int i = 0; i < m_NumThreads; i++)
{
if(m_apThreads[i])
thread_wait(m_apThreads[i]);
}





lock_wait(m_Lock);
// add job to queue
if(m_pLastJob)
m_pLastJob->m_pNext = pJob;
m_pLastJob = std::move(pJob);
if(!m_pFirstJob)
m_pFirstJob = m_pLastJob;
lock_unlock(m_Lock);
sphore_signal(&m_Semaphore);
sphore_wait you add a long curl job, and a very short condvar trigger job. I don't get how you guarantee the short condvar job doesn't finish before the long curl job























job run:
m_pMutex->lock();
m_pCond->signal();
m_pMutex-unlock();
main thread:
std::mutex M;
std::cond_variable C;
std::unique_lock<std::mutex> Lock(&M);
Pool()->AddJob(make_shared(new CWaitingJob(&M, &C)));
C.wait(&Lock);


















/*
Function: time_get_impl
Fetches a sample from a high resolution timer.
Returns:
Current value of the timer.
Remarks:
To know how fast the timer is ticking, see <time_freq>.
*/
is there smth that converts these stuff to doc?




1


1






















char m_aID[4]; this?







3





IVideo::Current()?





























































