diff --git a/xwords4/linux/linuxutl.c b/xwords4/linux/linuxutl.c index 3f3cc6906..dd9e87f9b 100644 --- a/xwords4/linux/linuxutl.c +++ b/xwords4/linux/linuxutl.c @@ -50,8 +50,8 @@ linux_debugf( const char* format, ... ) gettimeofday( &tv, &tz ); timp = localtime( &tv.tv_sec ); - size_t len = snprintf( buf, sizeof(buf), "<%d>%.2d:%.2d:%.2d:", getpid(), - timp->tm_hour, timp->tm_min, timp->tm_sec ); + size_t len = snprintf( buf, sizeof(buf), "<%d:%lu>%.2d:%.2d:%.2d:", getpid(), + pthread_self(), timp->tm_hour, timp->tm_min, timp->tm_sec ); XP_ASSERT( len < sizeof(buf) ); va_start(ap, format); diff --git a/xwords4/linux/scripts/start-pair.sh b/xwords4/linux/scripts/start-pair.sh new file mode 100755 index 000000000..68175be81 --- /dev/null +++ b/xwords4/linux/scripts/start-pair.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +set -e -u + +DB_TMPLATE=_cursesdb_ +LOG_TMPLATE=_curseslog_ +ROOM_TMPLATE=cursesRoom + +echo "delete from msgs;" | psql xwgames +echo "delete from games where room like '$ROOM_TMPLATE%';" | psql xwgames + +rm -f ${DB_TMPLATE}*.sqldb +rm -f ${LOG_TMPLATE}* + +PIDS='' +for GAME in $(seq 1); do + ROOM=${ROOM_TMPLATE}${GAME} + # for N in $(seq 2); do + for N in $(seq 1); do + DB=$DB_TMPLATE${GAME}_${N}.sqldb + LOG=$LOG_TMPLATE${GAME}_${N}.log + exec ./obj_linux_memdbg/xwords --server --curses --remote-player --name Player \ + --room $ROOM --game-dict dict.xwd \ + --skip-confirm --db $DB --close-stdin --server \ + >/dev/null 2>>$LOG & + PIDS="$PIDS $!" + done +done +echo "launched $PIDS" + +# --use-http \ + +sleep 10 + +for PID in $PIDS; do + kill $PID +done