Force thread count to 1 when pthreads is unavailable.

Don't want the thread count being misreported.
This commit is contained in:
Bill Currie 2018-09-09 13:41:22 +09:00
parent fa1514798b
commit aebd9288cd
1 changed files with 5 additions and 2 deletions

View File

@ -111,6 +111,9 @@ InitThreads (void)
stats_lock = malloc (sizeof (pthread_rwlock_t));
if (pthread_rwlock_init (stats_lock, 0))
Sys_Error ("pthread_rwlock_init failed");
#else
// Unable to run multi-threaded, so force threadcount to 1
options.threads = 1;
#endif
}
@ -1112,14 +1115,14 @@ main (int argc, char **argv)
dstring_t *portalfile = dstring_new ();
QFile *f;
InitThreads ();
start = Sys_DoubleTime ();
this_program = argv[0];
DecodeArgs (argc, argv);
InitThreads ();
if (!options.bspfile) {
usage (1);
Sys_Error ("%s: no bsp file specified.", this_program);