Thread improvements on CVS
Frediano Ziglio <[email protected]>
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Message-ID | <1315041618.19061.19.camel@ricky> |
Hi, for who is following CVS code you should have noted some changes during last days. I finally manage to find some time to sort out and fix my patches and work for thread and cancellation. For libTDS there is now a TDSSOCKET->wire_mtx mutex which serialize access to same connection (required). Currently this mutex is automatically locked and unlocked on state changes. It does not currently prevent memory races accessing TDSSOCKET outside sending/receiving data. For ODBC there are mutex for every structure (connection, statement, environment and descriptors) locked and unlocked for every function. Another change is cancellation. Currently a socketpair is used to advise sending thread of a pending cancellation. This way you can safely cancel from signal (as ctlib/dblib specification) and from another thread (as ODBC specification) without memory races problems. All these changes minimally affect token.c and query.c Frediano