From: Matthew Fernandez Date: Sat, 17 Oct 2020 01:41:22 +0000 (-0700) Subject: remove vmtx mutex no-ops X-Git-Tag: 2.46.0~20^2^2~16^2~24 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=28ed25cc8d5c2684ad55a1c7b74592f0d259d4d0;p=graphviz remove vmtx mutex no-ops --- diff --git a/lib/sfio/sfclose.c b/lib/sfio/sfclose.c index dd8e00759..f42465629 100644 --- a/lib/sfio/sfclose.c +++ b/lib/sfio/sfclose.c @@ -121,9 +121,7 @@ int sfclose(Sfio_t * f) /* destroy the mutex */ if (f->mutex) { - vtmtxclrlock(f->mutex); if (f != sfstdin && f != sfstdout && f != sfstderr) { - vtmtxclose(f->mutex); f->mutex = NIL(Vtmutex_t *); } } diff --git a/lib/sfio/sfexit.c b/lib/sfio/sfexit.c index 48e75f576..de63d5b52 100644 --- a/lib/sfio/sfexit.c +++ b/lib/sfio/sfexit.c @@ -44,8 +44,6 @@ waitpid(int pid, int *status, int options) if (options != 0) return -1; - vtmtxlock(_Sfmutex); - for (w = Wait, last = NIL(Waitpid_t *); w; last = w, w = w->next) { if (pid > 0 && pid != w->pid) continue; @@ -59,7 +57,6 @@ waitpid(int pid, int *status, int options) pid = w->pid; free(w); - vtmtxunlock(_Sfmutex); return pid; } @@ -68,7 +65,6 @@ waitpid(int pid, int *status, int options) if (status) *status = ps; - vtmtxunlock(_Sfmutex); return pid; } @@ -81,7 +77,6 @@ waitpid(int pid, int *status, int options) Wait = w; } - vtmtxunlock(_Sfmutex); return -1; } diff --git a/lib/sfio/sfextern.c b/lib/sfio/sfextern.c index a698801d4..830e22159 100644 --- a/lib/sfio/sfextern.c +++ b/lib/sfio/sfextern.c @@ -22,11 +22,6 @@ static Vtmutex_t Sfmutex; static Vtonce_t Sfonce = VTONCE_INITDATA; static void _sfoncef(void) { - vtmtxopen(_Sfmutex, VT_INIT); - vtmtxopen(&_Sfpool.mutex, VT_INIT); - vtmtxopen(sfstdin->mutex, VT_INIT); - vtmtxopen(sfstdout->mutex, VT_INIT); - vtmtxopen(sfstderr->mutex, VT_INIT); _Sfdone = 1; } diff --git a/lib/sfio/sfmode.c b/lib/sfio/sfmode.c index bca7187ac..b092b249a 100644 --- a/lib/sfio/sfmode.c +++ b/lib/sfio/sfmode.c @@ -194,12 +194,10 @@ int _sfpopen(Sfio_t * f, int fd, int pid, int stdio) if (p->sigp) { Sfsignal_f handler; - vtmtxlock(_Sfmutex); if ((handler = signal(SIGPIPE, ignoresig)) != SIG_DFL && handler != ignoresig) signal(SIGPIPE, handler); /* honor user handler */ _Sfsigp += 1; - vtmtxunlock(_Sfmutex); } #endif @@ -236,7 +234,6 @@ int _sfpclose(Sfio_t * f) status = -1; #ifdef SIGPIPE - vtmtxlock(_Sfmutex); if (p->sigp && (_Sfsigp -= 1) <= 0) { Sfsignal_f handler; if ((handler = signal(SIGPIPE, SIG_DFL)) != SIG_DFL && @@ -244,7 +241,6 @@ int _sfpclose(Sfio_t * f) signal(SIGPIPE, handler); /* honor user handler */ _Sfsigp = 0; } - vtmtxunlock(_Sfmutex); #endif } diff --git a/lib/sfio/vthread.h b/lib/sfio/vthread.h index d8cc18f09..897d15043 100644 --- a/lib/sfio/vthread.h +++ b/lib/sfio/vthread.h @@ -61,13 +61,6 @@ extern "C" { #define EPERM 1 #endif - extern Vtmutex_t *vtmtxopen(Vtmutex_t *, int); - extern int vtmtxclose(Vtmutex_t *); - extern int vtmtxlock(Vtmutex_t *); - extern int vtmtxtrylock(Vtmutex_t *); - extern int vtmtxunlock(Vtmutex_t *); - extern int vtmtxclrlock(Vtmutex_t *); - extern void *vtstatus(Vthread_t *); extern int vterror(Vthread_t *); extern int vtmtxerror(Vtmutex_t *); @@ -89,13 +82,6 @@ extern "C" { #define VTONCE_INITDATA {0} -#define vtmtxopen(mtx,flgs) (void)((Vtmutex_t*)0) -#define vtmtxclose(mtx) (void)(-1) -#define vtmtxlock(mtx) (void)(-1) -#define vtmtxtrylock(mtx) (-1) -#define vtmtxunlock(mtx) (void)(-1) -#define vtmtxclrlock(mtx) (void)(-1) - #define vtstatus(vt) ((void*)0) #define vterror(vt) (0) #define vtmtxerror(mtx) (0)