------- Comment #11 from guilhem at kaffe dot org 2005-11-25 19:10 ------- I feel a potential race condition in this patch. What happens in that case ?
thread 2: => PlainSocketImpl.accept => enters _Jv_select thread 1: => shutdown socket => close socket thread 3: => create another socket which occurs to have the same fd. thread 2: => select wakes up => we call accept with the old fd thread 1: => set native_fd to -1 I expect this scheme may be a flaw and it is not forbidden by the current code. A simple fix would be to add a synchronization lock before accepting the connection. Wrong ? -- guilhem at kaffe dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |guilhem at kaffe dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15430