mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-12 08:47:50 +01:00
switch to milliseconds
This commit is contained in:
parent
cc54621e45
commit
d05a67ed4b
1 changed files with 9 additions and 9 deletions
|
@ -29,13 +29,13 @@
|
||||||
#include "comtypes.h"
|
#include "comtypes.h"
|
||||||
#include "gamesdb.h"
|
#include "gamesdb.h"
|
||||||
|
|
||||||
#define MAX_MOVE_CHECK_SECS ((XP_U16)(60 * 60 * 24))
|
#define MAX_MOVE_CHECK_MS ((XP_U16)(1000 * 60 * 60 * 24))
|
||||||
#define RELAY_API_PROTO "http"
|
#define RELAY_API_PROTO "http"
|
||||||
|
|
||||||
typedef struct _RelayConStorage {
|
typedef struct _RelayConStorage {
|
||||||
pthread_t mainThread;
|
pthread_t mainThread;
|
||||||
guint moveCheckerID;
|
guint moveCheckerID;
|
||||||
XP_U16 nextMoveCheckSecs;
|
XP_U32 nextMoveCheckMS;
|
||||||
pthread_cond_t relayCondVar;
|
pthread_cond_t relayCondVar;
|
||||||
pthread_mutex_t relayMutex;
|
pthread_mutex_t relayMutex;
|
||||||
GSList* relayTaskList;
|
GSList* relayTaskList;
|
||||||
|
@ -779,7 +779,7 @@ static void
|
||||||
reset_schedule_check_interval( RelayConStorage* storage )
|
reset_schedule_check_interval( RelayConStorage* storage )
|
||||||
{
|
{
|
||||||
XP_ASSERT( onMainThread(storage) );
|
XP_ASSERT( onMainThread(storage) );
|
||||||
storage->nextMoveCheckSecs = 0;
|
storage->nextMoveCheckMS = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -792,14 +792,14 @@ schedule_next_check( RelayConStorage* storage )
|
||||||
storage->moveCheckerID = 0;
|
storage->moveCheckerID = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
storage->nextMoveCheckSecs *= 2;
|
storage->nextMoveCheckMS *= 2;
|
||||||
if ( storage->nextMoveCheckSecs > MAX_MOVE_CHECK_SECS ) {
|
if ( storage->nextMoveCheckMS > MAX_MOVE_CHECK_MS ) {
|
||||||
storage->nextMoveCheckSecs = MAX_MOVE_CHECK_SECS;
|
storage->nextMoveCheckMS = MAX_MOVE_CHECK_MS;
|
||||||
} else if ( storage->nextMoveCheckSecs == 0 ) {
|
} else if ( storage->nextMoveCheckMS == 0 ) {
|
||||||
storage->nextMoveCheckSecs = 1;
|
storage->nextMoveCheckMS = 250;
|
||||||
}
|
}
|
||||||
|
|
||||||
storage->moveCheckerID = g_timeout_add( 1000 * storage->nextMoveCheckSecs,
|
storage->moveCheckerID = g_timeout_add( storage->nextMoveCheckMS,
|
||||||
checkForMoves, storage );
|
checkForMoves, storage );
|
||||||
XP_ASSERT( storage->moveCheckerID != 0 );
|
XP_ASSERT( storage->moveCheckerID != 0 );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue