--- a/functions.h Thu Aug 04 18:02:03 2005 +0000
+++ b/functions.h Fri Aug 05 08:24:12 2005 +0000
@@ -279,6 +279,5 @@
void bubblesort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *));
bool CreateOTTDThread(void *func, void *param);
-void CloseOTTDThread(void);
void JoinOTTDThread(void);
#endif /* FUNCTIONS_H */
--- a/os2.c Thu Aug 04 18:02:03 2005 +0000
+++ b/os2.c Fri Aug 05 08:24:12 2005 +0000
@@ -647,12 +647,6 @@
return(true);
}
-void CloseOTTDThread(void)
-{
- _endthread();
- return;
-}
-
void JoinOTTDThread(void)
{
if (thread1 == 0)
--- a/saveload.c Thu Aug 04 18:02:03 2005 +0000
+++ b/saveload.c Fri Aug 05 08:24:12 2005 +0000
@@ -1292,7 +1292,6 @@
fclose(_sl.fh);
SaveFileDone();
- if (*(bool*)ptr) CloseOTTDThread();
return true;
}
@@ -1364,7 +1363,6 @@
/* General tactic is to first save the game to memory, then use an available writer
* to write it to file, either in threaded mode if possible, or single-threaded */
if (mode == SL_SAVE) { /* SAVE game */
- bool threaded = true;
fmt = GetSavegameFormat("memory"); // write to memory
_sl.write_bytes = fmt->writer;
@@ -1381,10 +1379,9 @@
SlWriteFill(); // flush the save buffer
/* Write to file */
- if (_network_server || !CreateOTTDThread(&SaveFileToDisk, &threaded)) {
+ if (_network_server || !CreateOTTDThread(&SaveFileToDisk, NULL)) {
DEBUG(misc, 1) ("cannot create savegame thread, reverting to single-threaded mode...");
- threaded = false;
- SaveFileToDisk(&threaded);
+ SaveFileToDisk(NULL);
}
} else { /* LOAD game */
--- a/unix.c Thu Aug 04 18:02:03 2005 +0000
+++ b/unix.c Fri Aug 05 08:24:12 2005 +0000
@@ -530,8 +530,6 @@
return pthread_create(&thread1, NULL, func, param) == 0;
}
-void CloseOTTDThread(void) {return;}
-
void JoinOTTDThread(void)
{
if (thread1 == 0) return;
--- a/win32.c Thu Aug 04 18:02:03 2005 +0000
+++ b/win32.c Fri Aug 05 08:24:12 2005 +0000
@@ -1204,16 +1204,12 @@
return hThread != NULL;
}
-void CloseOTTDThread(void)
-{
- if (!CloseHandle(hThread)) DEBUG(misc, 0) ("Failed to close thread?...");
-}
-
void JoinOTTDThread(void)
{
if (hThread == NULL) return;
WaitForSingleObject(hThread, INFINITE);
+ if (!CloseHandle(hThread)) DEBUG(misc, 0) ("Failed to close thread handle!");
}