diff --git a/include/libwebsockets/lws-eventlib-exports.h b/include/libwebsockets/lws-eventlib-exports.h index fedccc286..87c4085b3 100644 --- a/include/libwebsockets/lws-eventlib-exports.h +++ b/include/libwebsockets/lws-eventlib-exports.h @@ -58,4 +58,29 @@ lws_destroy_event_pipe(struct lws *wsi); LWS_VISIBLE LWS_EXTERN void __lws_close_free_wsi_final(struct lws *wsi); +#if LWS_MAX_SMP > 1 +struct lws_mutex_refcount { + pthread_mutex_t lock; + pthread_t lock_owner; + const char *last_lock_reason; + char lock_depth; + char metadata; +}; + +LWS_VISIBLE LWS_EXTERN void +lws_mutex_refcount_assert_held(struct lws_mutex_refcount *mr); + +LWS_VISIBLE LWS_EXTERN void +lws_mutex_refcount_init(struct lws_mutex_refcount *mr); + +LWS_VISIBLE LWS_EXTERN void +lws_mutex_refcount_destroy(struct lws_mutex_refcount *mr); + +LWS_VISIBLE LWS_EXTERN void +lws_mutex_refcount_lock(struct lws_mutex_refcount *mr, const char *reason); + +LWS_VISIBLE LWS_EXTERN void +lws_mutex_refcount_unlock(struct lws_mutex_refcount *mr); + +#endif diff --git a/lib/core/private-lib-core.h b/lib/core/private-lib-core.h index 55d4aeab0..b47b4b2b2 100644 --- a/lib/core/private-lib-core.h +++ b/lib/core/private-lib-core.h @@ -231,32 +231,6 @@ struct lws_foreign_thread_pollfd { }; #endif /* network */ -#if LWS_MAX_SMP > 1 - -struct lws_mutex_refcount { - pthread_mutex_t lock; - pthread_t lock_owner; - const char *last_lock_reason; - char lock_depth; - char metadata; -}; - -void -lws_mutex_refcount_init(struct lws_mutex_refcount *mr); - -void -lws_mutex_refcount_destroy(struct lws_mutex_refcount *mr); - -void -lws_mutex_refcount_lock(struct lws_mutex_refcount *mr, const char *reason); - -void -lws_mutex_refcount_assert_held(struct lws_mutex_refcount *mr); - -void -lws_mutex_refcount_unlock(struct lws_mutex_refcount *mr); -#endif - #if defined(LWS_WITH_NETWORK) #include "private-lib-core-net.h" #endif