diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2013-03-11 01:16:34 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2013-03-11 01:16:34 +0100 |
commit | 631aef280d0363ea853b0ab878005e48153b5eea (patch) | |
tree | c2fa3af95277b317c9dc87a345317fe99b6b1445 /sys/src/ape/lib/ap/arm/main9.s | |
parent | d526ee0750815820ac70e030ff87775ac56785e3 (diff) |
ape: fix thread race with close() and select()
in ape close(), do the real filedescriptor _CLOSE() *after* we cleared
the _fdinfo[] slot because once closed, we dont own the slot anymore and
another process doing open() can trash the slot. make sure open() retuns
fd < OPEN_MAX.
double check in _startbuf() holding mux->lock if the fd is already buffered
preveting running double copyprocs on a fd.
dont zero the mux->rwant/ewant bitmaps at the end of select() as we do not
hold the mix->lock.
in _closebuf() kill copyproc while holding the mux->lock to make sure the
copyproc isnt holding it at the time it is killed. run kill() multiple times
to make sure the proc is gone.
Diffstat (limited to 'sys/src/ape/lib/ap/arm/main9.s')
0 files changed, 0 insertions, 0 deletions