diff options
author | truelight <truelight@openttd.org> | 2006-08-20 13:39:33 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2006-08-20 13:39:33 +0000 |
commit | a06d5548ebe58ab290be50ca4b31368db5f4bc10 (patch) | |
tree | 2f784ed7fc2f9f935ddaf767abefd0e0aa5a4099 /saveload.c | |
parent | e159ada7a2a0367c99e94ee07b1d439e7ffacc0b (diff) | |
download | openttd-a06d5548ebe58ab290be50ca4b31368db5f4bc10.tar.xz |
(svn r5977) -Fix [FS#78]: never set I-am-a-thread bool to true IN the thread. Machines with
dualcore can be faster then you want, and therefor create 2 threads, while
you made the bool to make sure there is never more then 1 thread of this type.
Diffstat (limited to 'saveload.c')
-rw-r--r-- | saveload.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/saveload.c b/saveload.c index e02693ba8..7a9f7ba29 100644 --- a/saveload.c +++ b/saveload.c @@ -1402,8 +1402,6 @@ static void* SaveFileToDisk(void *arg) const SaveLoadFormat *fmt; uint32 hdr[2]; - if (arg != NULL) OTTD_SendThreadMessage(MSG_OTTD_SAVETHREAD_START); - /* XXX - Setup setjmp error handler if an error occurs anywhere deep during * loading/saving execute a longjmp() and continue execution here */ if (setjmp(_sl.excpt)) { @@ -1536,10 +1534,12 @@ SaveOrLoadResult SaveOrLoad(const char *filename, int mode) SlSaveChunks(); SlWriteFill(); // flush the save buffer + SaveFileStart(); if (_network_server || (save_thread = OTTDCreateThread(&SaveFileToDisk, (void*)"")) == NULL) { DEBUG(misc, 1) ("[Sl] Cannot create savegame thread, reverting to single-threaded mode..."); SaveFileToDisk(NULL); + SaveFileDone(); } } else { /* LOAD game */ |