1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

evlib: export LWS_MAX_SMP locking for evlib plugin case with SMP

Now we're also looking at SMP + event lib, SMP locking pieces are
going to be needed for import into the event lib plugins if built
as plugins.
This commit is contained in:
Andy Green 2020-09-30 19:54:00 +01:00
parent 08c9395da5
commit 636f9c7f01
2 changed files with 25 additions and 26 deletions

View file

@ -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

View file

@ -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