#undef SF_MTSAFE /* no need to worry about thread-safety */
#define SF_MTSAFE 0
-#define SFMTXLOCK(f) (void)(0)
#define SFMTXUNLOCK(f) (void)(0)
#define SFMTXSTART(f,v) { if(!f) return(v); }
#define SFMTXRETURN(f,v) { return(v); }
** Written by Kiem-Phong Vo.
*/
-#define STKMTXLOCK(f1,f2) \
- { if(f1) SFMTXLOCK(f1); \
- if(f2) SFMTXLOCK(f2); \
- }
#define STKMTXRETURN(f1,f2,rv) \
{ if(f1) SFMTXUNLOCK(f1); \
if(f2) SFMTXUNLOCK(f2); \
Sfio_t *rf;
Sfrsrv_t *rsrv;
- STKMTXLOCK(f1, f2);
-
if (f1 && (f1->mode & SF_RDWR) != f1->mode && _sfmode(f1, 0, 0) < 0)
STKMTXRETURN(f1, f2, NIL(Sfio_t *));
if (f2 && (f2->mode & SF_RDWR) != f2->mode && _sfmode(f2, 0, 0) < 0)