common: add start arg to RunThreadsOn to set initial progress
In case we are not starting work from 0, allow this to be set... Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
This commit is contained in:
parent
853761d0d6
commit
3e20dae28e
|
|
@ -87,13 +87,13 @@ ThreadUnlock(void)
|
|||
* =============
|
||||
*/
|
||||
void
|
||||
RunThreadsOn(int workcnt, void *(func)(void *))
|
||||
RunThreadsOn(int start, int workcnt, void *(func)(void *))
|
||||
{
|
||||
int i;
|
||||
DWORD *threadid;
|
||||
HANDLE *threadhandle;
|
||||
|
||||
dispatch = 0;
|
||||
dispatch = start;
|
||||
workcount = workcnt;
|
||||
oldpercent = -1;
|
||||
|
||||
|
|
@ -175,7 +175,7 @@ ThreadUnlock(void)
|
|||
* =============
|
||||
*/
|
||||
void
|
||||
RunThreadsOn(int workcnt, void *(func)(void *))
|
||||
RunThreadsOn(int start, int workcnt, void *(func)(void *))
|
||||
{
|
||||
pthread_t *threads;
|
||||
pthread_mutexattr_t mattrib;
|
||||
|
|
@ -183,7 +183,7 @@ RunThreadsOn(int workcnt, void *(func)(void *))
|
|||
int status;
|
||||
int i;
|
||||
|
||||
dispatch = 0;
|
||||
dispatch = start;
|
||||
workcount = workcnt;
|
||||
oldpercent = -1;
|
||||
|
||||
|
|
@ -254,9 +254,9 @@ void ThreadUnlock(void) {}
|
|||
* =============
|
||||
*/
|
||||
void
|
||||
RunThreadsOn(int workcnt, void *(func)(void *))
|
||||
RunThreadsOn(int start, int workcnt, void *(func)(void *))
|
||||
{
|
||||
dispatch = 0;
|
||||
dispatch = start;
|
||||
workcount = workcnt;
|
||||
oldpercent = -1;
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ int GetDefaultThreads(void);
|
|||
int GetMaxThreads(void); /* returns 0 if no limit specified */
|
||||
int GetThreadWork(void);
|
||||
int GetThreadWork_Locked__(void); /* caller must take care of locking */
|
||||
void RunThreadsOn(int workcnt, void *(func)(void *));
|
||||
void RunThreadsOn(int start, int workcnt, void *(func)(void *));
|
||||
void ThreadLock(void);
|
||||
void ThreadUnlock(void);
|
||||
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ LightWorld(void)
|
|||
lit_file_end = lit_filebase + 3 * (MAX_MAP_LIGHTING / 4);
|
||||
}
|
||||
|
||||
RunThreadsOn(numfaces, LightThread);
|
||||
RunThreadsOn(0, numfaces, LightThread);
|
||||
lightdatasize = file_p - filebase;
|
||||
logprint("lightdatasize: %i\n", lightdatasize);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -489,5 +489,5 @@ BasePortalThread(void *dummy)
|
|||
void
|
||||
BasePortalVis(void)
|
||||
{
|
||||
RunThreadsOn(numportals * 2, BasePortalThread);
|
||||
RunThreadsOn(0, numportals * 2, BasePortalThread);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue