Skip to content

Commit

Permalink
XXX thread.h Save errno around lock/unlock
Browse files Browse the repository at this point in the history
  • Loading branch information
khwilliamson committed May 5, 2021
1 parent 9811f39 commit be4e953
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions thread.h
Expand Up @@ -208,20 +208,24 @@

# define MUTEX_LOCK(m) \
STMT_START { \
dSAVE_ERRNO; \
int _eC_; \
if ((_eC_ = perl_pthread_mutex_lock((m)))) \
Perl_croak_nocontext("panic: MUTEX_LOCK (%d) [%s:%d]",\
_eC_, __FILE__, __LINE__); \
RESTORE_ERRNO; \
} STMT_END

# define MUTEX_UNLOCK(m) \
STMT_START { \
dSAVE_ERRNO; /* Shouldn't be necessary as panics if fails */\
int _eC_; \
if ((_eC_ = perl_pthread_mutex_unlock((m)))) { \
Perl_croak_nocontext( \
"panic: MUTEX_UNLOCK (%d) [%s:%d]", \
_eC_, __FILE__, __LINE__); \
} \
RESTORE_ERRNO; \
} STMT_END

# define MUTEX_DESTROY(m) \
Expand Down

0 comments on commit be4e953

Please sign in to comment.