From 643f2e675fef74bee80645826b8c1ac848e75a2c Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 17 Oct 2020 12:41:41 -0700 Subject: [PATCH] remove no-op SFMTXLOCK() --- lib/sfio/sfhdr.h | 1 - lib/sfio/sfmode.c | 1 - lib/sfio/sfstack.c | 6 ------ 3 files changed, 8 deletions(-) diff --git a/lib/sfio/sfhdr.h b/lib/sfio/sfhdr.h index 51cbe7aad..7db0b8d57 100644 --- a/lib/sfio/sfhdr.h +++ b/lib/sfio/sfhdr.h @@ -85,7 +85,6 @@ extern "C" { #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); } diff --git a/lib/sfio/sfmode.c b/lib/sfio/sfmode.c index d673e49e7..657855c2c 100644 --- a/lib/sfio/sfmode.c +++ b/lib/sfio/sfmode.c @@ -60,7 +60,6 @@ static void _sfcleanup(void) continue; SFLOCK(f, 0); - SFMTXLOCK(f); /* let application know that we are leaving */ (void) SFRAISE(f, SF_ATEXIT, NIL(void *)); diff --git a/lib/sfio/sfstack.c b/lib/sfio/sfstack.c index e7ef77ae6..2c765c496 100644 --- a/lib/sfio/sfstack.c +++ b/lib/sfio/sfstack.c @@ -19,10 +19,6 @@ ** 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); \ @@ -39,8 +35,6 @@ Sfio_t *sfstack(Sfio_t * f1, Sfio_t * 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) -- 2.40.0