]> granicus.if.org Git - graphviz/commitdiff
remove unused mutex field from SFIO structures
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 17 Oct 2020 02:15:59 +0000 (19:15 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 24 Oct 2020 02:16:10 +0000 (19:16 -0700)
lib/sfio/sfclose.c
lib/sfio/sfhdr.h
lib/sfio/sfio_t.h
lib/sfio/sfnew.c
lib/sfio/sfstack.c

index f424656298dd12c28d1835a66c65c067033e389c..d83c38cfa14bf1a396257ddc988f0308e68dd2fc 100644 (file)
@@ -119,13 +119,6 @@ int sfclose(Sfio_t * f)
     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;
index 1f29c352eb3513f48be751b1deaf81e87ed2b360..e9cf3bdd7bce8959b92a474636985ae3dc71375e 100644 (file)
@@ -291,7 +291,6 @@ extern "C" {
        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 */
index dd9f630fb7705a5b04f1c506e410ef5e414162b6..dac230e68b4c40f2d35e80994851da15dfe0fd28 100644 (file)
@@ -38,7 +38,6 @@ extern "C" {
        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          */
@@ -76,7 +75,6 @@ extern "C" {
          (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         */ \
@@ -104,7 +102,6 @@ extern "C" {
          (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         */ \
index 42bb62d30a16a124b1ec410ba103974f6328ba2d..757432922409ba4656f52ad6c4f1ba4a507220fa 100644 (file)
@@ -39,9 +39,6 @@ Sfio_t *sfnew(Sfio_t * oldf, void * buf, size_t size, int file,
     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))
@@ -72,7 +69,6 @@ Sfio_t *sfnew(Sfio_t * oldf, void * buf, size_t size, int file,
            if (f) {
                if (f->mode & SF_AVAIL) {
                    sflags = f->flags;
-                   SFCLEAR(f, f->mutex);
                } else
                    f = NIL(Sfio_t *);
            }
index faadd2d84de239bbce941187cdd59028e41517b0..e7ef77ae6ce2f1e4865f24d1b9fb7c997aed448b 100644 (file)
@@ -38,7 +38,6 @@ Sfio_t *sfstack(Sfio_t * f1, Sfio_t * f2)
     int n;
     Sfio_t *rf;
     Sfrsrv_t *rsrv;
-    Vtmutex_t *mtx;
 
     STKMTXLOCK(f1, f2);
 
@@ -79,9 +78,6 @@ Sfio_t *sfstack(Sfio_t * f1, Sfio_t * f2)
     rsrv = f1->rsrv;
     f1->rsrv = f2->rsrv;
     f2->rsrv = rsrv;
-    mtx = f1->mutex;
-    f1->mutex = f2->mutex;
-    f2->mutex = mtx;
 
     SFLOCK(f1, 0);
     SFLOCK(f2, 0);