[WIP/FIX] Lock write operations to XMPP

I *think* that fixes stream errors with two threads writing at once.
Even if it doesn't, I think it's always a nice-to-have.
This commit is contained in:
LDA 2024-06-23 17:54:58 +02:00
commit 37155316b2
4 changed files with 32 additions and 0 deletions

View file

@ -3,9 +3,14 @@
#include <Cytoplasm/Stream.h>
#include <pthread.h>
#include <XML.h>
typedef struct XMPPComponent {
/* A lock for all write operations */
pthread_mutex_t write_lock;
char *host;
Stream *stream;
} XMPPComponent;