if (f->proc)
rv = _sfpclose(f);
- /* destroy the mutex */
- if (f->mutex) {
- if (f != sfstdin && f != sfstdout && f != sfstderr) {
- f->mutex = NIL(Vtmutex_t *);
- }
- }
-
if (!local) {
if (f->disc && (ex = SFRAISE(f, SF_FINAL, NIL(void *))) != 0) {
rv = ex;
int n_sf; /* number currently in pool */
Sfio_t **sf; /* array of streams */
Sfio_t *array[3]; /* start with 3 */
- Vtmutex_t mutex; /* mutex lock object */
};
/* reserve buffer structure */
struct _sfpool_s* pool; /* the pool containing this */ \
struct _sfrsrv_s* rsrv; /* reserved buffer */ \
struct _sfproc_s* proc; /* coprocess id, etc. */ \
- void* mutex; /* mutex for thread-safety */ \
void* stdio; /* stdio FILE if any */ \
Sfoff_t lpos; /* last seek position */ \
size_t iosz; /* prefer size for I/O */
(struct _sfpool_s*)0, /* pool */ \
(struct _sfrsrv_s*)0, /* rsrv */ \
(struct _sfproc_s*)0, /* proc */ \
- (mutex), /* mutex */ \
(void*)0, /* stdio */ \
(Sfoff_t)0, /* lpos */ \
(size_t)0 /* iosz */ \
(f)->pool = (struct _sfpool_s*)0, /* pool */ \
(f)->rsrv = (struct _sfrsrv_s*)0, /* rsrv */ \
(f)->proc = (struct _sfproc_s*)0, /* proc */ \
- (f)->mutex = (mtx), /* mutex */ \
(f)->stdio = (void*)0, /* stdio */ \
(f)->lpos = (Sfoff_t)0, /* lpos */ \
(f)->iosz = (size_t)0 /* iosz */ \
sflags = 0;
if ((f = oldf)) {
if (flags & SF_EOF) {
- if (f != sfstdin && f != sfstdout && f != sfstderr)
- f->mutex = NIL(Vtmutex_t *);
- SFCLEAR(f, f->mutex);
oldf = NIL(Sfio_t *);
} else if (f->mode & SF_AVAIL) { /* only allow SF_STATIC to be already closed */
if (!(f->flags & SF_STATIC))
if (f) {
if (f->mode & SF_AVAIL) {
sflags = f->flags;
- SFCLEAR(f, f->mutex);
} else
f = NIL(Sfio_t *);
}