Skip to content

Commit

Permalink
Fixed thread wait, merge problems
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Jan 19, 2004
1 parent ceaf21f commit a2a88bf
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions doomsday/Src/dd_input.c
@@ -1,5 +1,5 @@
/* DE1: $Id$
* Copyright (C) 2003 Jaakko Ker�en <jaakko.keranen@iki.fi>
* Copyright (C) 2003 Jaakko Keränen <jaakko.keranen@iki.fi>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -428,7 +428,7 @@ void DD_PostEvent(event_t *ev)
Sys_Lock(eventQueueLock);

events[eventHead] = *ev;
eventHead = (++eventHead) & (MAXEVENTS - 1);
eventHead = (eventHead + 1) & (MAXEVENTS - 1);
eventCount++;

Sys_Unlock(eventQueueLock);
Expand Down Expand Up @@ -810,11 +810,8 @@ void DD_StopInput(void)
// Tell the input thread to immediately break the loop and exit.
stopInputThread = true;

while(!Sys_GetThreadExitCode(inputThreadHandle, NULL))
{
// Let's wait for a short while.
Sys_Sleep(1);
}
// Wait for the input thread to stop.
Sys_WaitThread(inputThreadHandle);
}

/*
Expand Down

0 comments on commit a2a88bf

Please sign in to comment.