Commit graph

12 commits

Author SHA1 Message Date
ehouse
8284799abe Fix crashes resulting from deleting cref instances in one thread while
another wanted to operate on them.  The root problem is that you can't
dispose of a mutex while somebody's blocking on it.  So now the
locking mutexes live inside the cref class.  When the lock owner
realizes the cref needs to die, it sets a flag and it's moved to a
recycled list.  A thread blocking on the mutex will then get it, but
checks the flag and releases it immediately if it's being recycled.
(Also improve the http interface a bit.)  With these changes I've run
31K (and counting) games against the relay without a crash or deadlock
(using sim_real.sh.)  The main problem that remains is that sometimes
two games using the same cookie wind up with two crefs (and so never
connect.)
2009-07-28 05:15:26 +00:00
ehouse
ea6fff8f28 replace int with bool where appropriate; fix to compile with newer g++ 2008-12-30 05:13:30 +00:00
ehouse
92485783af update email address in header comments: no code change 2006-01-08 01:25:02 +00:00
ehouse
6541e56c40 catch up with logf change 2005-10-14 08:27:16 +00:00
ehouse
05878f11a4 Do nothing rather than assert when socket no longer found for write.
Not sure if this is a preventable error.
2005-09-05 15:50:28 +00:00
ehouse
aa1323a5a3 shorten log messages; make easier to process from perl 2005-09-04 20:38:23 +00:00
ehouse
8f32f4f99a loads of changes: get settings from config file; remove sockets and
kill crefs via state machine, and protect access to a cref so it can
die without another thread being in it; do timers via timeout to
poll() rather than interrupt (and integrate into state machine);
detect when all players are present and change state so new
connections on that cookie will get a new cref.
2005-09-02 06:56:34 +00:00
ehouse
170ad8f419 make overly verbose logging conditional 2005-08-02 04:56:08 +00:00
ehouse
12fc28315c more debug info 2005-04-20 11:59:08 +00:00
ehouse
fdca4b0a88 add rwlock helper classes 2005-04-08 14:18:14 +00:00
ehouse
9dcec7d66c new include 2005-03-30 01:49:40 +00:00
ehouse
120a3c1773 first checked in 2005-03-25 02:59:10 +00:00