From c42bd5f05e744e0d863d0b10552d490377e06c63 Mon Sep 17 00:00:00 2001 From: midipix Date: Mon, 28 Oct 2019 04:19:56 +0000 Subject: internals: added lt_slock(), lt_sunlock(). --- src/core/lt_core.c | 15 +++++++++++++++ src/internal/sltdl_core.h | 7 +++++++ 2 files changed, 22 insertions(+) create mode 100644 src/internal/sltdl_core.h (limited to 'src') diff --git a/src/core/lt_core.c b/src/core/lt_core.c index b0c3952..df9f58f 100644 --- a/src/core/lt_core.c +++ b/src/core/lt_core.c @@ -38,3 +38,18 @@ int lt_dlexit(void) return 0; } + +void lt_slock(void) +{ + int locked; + + do { + locked = pthread_mutex_lock(<_lock); + } while (locked); +} + +int lt_sunlock(int ret) +{ + pthread_mutex_unlock(<_lock); + return ret; +} diff --git a/src/internal/sltdl_core.h b/src/internal/sltdl_core.h new file mode 100644 index 0000000..f74542e --- /dev/null +++ b/src/internal/sltdl_core.h @@ -0,0 +1,7 @@ +#ifndef SLTDL_CORE_H +#define SLTDL_CORE_H + +void lt_slock(void); +int lt_sunlock(int); + +#endif -- cgit v1.2.3