summaryrefslogtreecommitdiff
path: root/src/thread_morphos.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-06-08 10:51:36 +0000
committerrubidium <rubidium@openttd.org>2008-06-08 10:51:36 +0000
commit96d7f87cc99ee04791b9fa097a027a17bb82226b (patch)
tree051108d9da4b980db5e5e7eb8c7b81c8ea89e9ae /src/thread_morphos.cpp
parentb1dc70549245677303a1fdc0da57df92d80242fa (diff)
downloadopenttd-96d7f87cc99ee04791b9fa097a027a17bb82226b.tar.xz
(svn r13411) -Codechange: remove the return value from the thread procs because it is never used.
Diffstat (limited to 'src/thread_morphos.cpp')
-rw-r--r--src/thread_morphos.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/thread_morphos.cpp b/src/thread_morphos.cpp
index 6cd9e1498..ef074da45 100644
--- a/src/thread_morphos.cpp
+++ b/src/thread_morphos.cpp
@@ -34,7 +34,6 @@ struct OTTDThreadStartupMessage {
struct Message msg; ///< standard exec.library message (MUST be the first thing in the message struct!)
OTTDThreadFunc func; ///< function the thread will execute
void *arg; ///< functions arguments for the thread function
- void *ret; ///< return value of the thread function
};
@@ -79,7 +78,6 @@ public:
/* Things we'll pass down to the child by utilizing NP_StartupMsg */
m_msg.func = proc;
m_msg.arg = param;
- m_msg.ret = NULL;
m_replyport = CreateMsgPort();
@@ -161,10 +159,9 @@ public:
return true;
}
- /* virtual */ void *Join()
+ /* virtual */ void Join()
{
struct OTTDThreadStartupMessage *reply;
- void *ret;
/* You cannot join yourself */
assert(!IsCurrent());
@@ -173,13 +170,9 @@ public:
KPutStr("[OpenTTD] Wait for child to quit...\n");
WaitPort(m_replyport);
- reply = (struct OTTDThreadStartupMessage *)GetMsg(m_replyport);
- ret = reply->ret;
-
+ GetMsg(m_replyport);
DeleteMsgPort(m_replyport);
m_thr = 0;
-
- return ret;
}
/* virtual */ bool IsCurrent()
@@ -209,7 +202,7 @@ private:
if (NewGetTaskAttrs(NULL, &msg, sizeof(struct OTTDThreadStartupMessage *), TASKINFOTYPE_STARTUPMSG, TAG_DONE) && msg != NULL) {
try {
- msg->ret = msg->func(msg->arg);
+ msg->func(msg->arg);
} catch(...) {
KPutStr("[Child] Returned to main()\n");
}
@@ -256,7 +249,7 @@ public:
/* virtual */ void Set()
{
- // Check if semaphore count is really important there.
+ /* Check if semaphore count is really important there. */
ReleaseSemaphore(&m_sem);
}