Race conditions in serial_select
Gaer, A.
Andreas.Gaer@baslerweb.com
Fri Jun 17 09:47:00 GMT 2005
Hello all!
The serial_select() implementation from
"io/serial/current/src/common/serial.c" doesn't care about concurrent access
to the cbuf structure. This leads to race conditions when the serial DSR
routine changes the counters in this structure while select checks for
"cbuf->nb == 0". As a result, user threads that sleep because of a select
call will not be woken up, even if data arrives. Also access to this
structure isn't implemented thread-safe because of missing mutex locks. The
attached patch fixes this problems.
Best regards,
Andreas.
_______________________________
Andreas Gäer
Software Engineer
Basler Vision Technologies
An der Strusbek 60-62
22926 Ahrensburg
Germany
Tel +49 (4102) 463-517
Fax +49 (4102) 463-46211
mailto: Andreas.Gaer@baslerweb.com
http://www.baslerweb.com
_______________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: serial_select.diff
Type: application/octet-stream
Size: 3140 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/ecos-patches/attachments/20050617/a55eb536/attachment.obj>
More information about the Ecos-patches
mailing list