Add sequence numbers to game state (experimental)
This catches output dependency violations, e.g. two threads doing a read-modify-write without synchronization. New struct emptypedstr member seqno. Make sure all members of unit empobj_storage share it. Set it in ef_blank() and ef_set_uid(), step it in ef_write(). fairland and files don't use ef_set_uid(); need to set it manually in files.c's main() and file_sct_init(). Factor do_read() out of fillcache() to make it available for new get_seqno().
This commit is contained in:
parent
2aec870a14
commit
dc9d847b8b
20 changed files with 124 additions and 18 deletions
|
@ -46,6 +46,7 @@ struct sctstr {
|
|||
/* initial part must match struct empobj */
|
||||
short ef_type;
|
||||
short sct_uid; /* equals XYOFFSET(sct_x, sct_y) */
|
||||
unsigned sct_seqno;
|
||||
time_t sct_timestamp; /* Last time this sector was written to */
|
||||
natid sct_own; /* owner's country num */
|
||||
coord sct_x; /* x coord of sector */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue