OSDN Git Service

Fix #35795: A time consumed could be -1 201512-timeclock
authorDaigo Moriwaki <daigo@debian.org>
Fri, 27 Nov 2015 14:40:28 +0000 (23:40 +0900)
committerDaigo Moriwaki <daigo@debian.org>
Fri, 27 Nov 2015 14:40:28 +0000 (23:40 +0900)
commit3d228b20abc8b692cc42cc3d5c57686269de2279
treedf9dd9e109082c496f241ba6130ce35d86e1cb67
parent1b3407692131e16a8af23434f41b381134bf2fc0
Fix #35795: A time consumed could be -1

* [shogi-server] shogi_server/time_clock.rb:
  - A time consumed could be -1.
    * The start time of a move is captured after sending a move to a
      player of the next turn at the end of the giant lock
    * The end time of the move is captured at the exact time when the
      server receives it before the giant lock
    Therefore, end_time < start_time is possible when a player returns a
    move instantly.
    Thanks to Tomoyuki Kaneko for reporting this issue.
    (Closes: #35795)
changelog
shogi_server/time_clock.rb
test/TC_time_clock.rb