Use wrapped threading functions in ha plugin
This commit is contained in:
@@ -20,10 +20,10 @@
|
||||
#include <sys/socket.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include <daemon.h>
|
||||
#include <utils/host.h>
|
||||
#include <threading/thread.h>
|
||||
#include <processing/jobs/callback_job.h>
|
||||
|
||||
typedef struct private_ha_socket_t private_ha_socket_t;
|
||||
@@ -121,12 +121,12 @@ METHOD(ha_socket_t, pull, ha_message_t*,
|
||||
{
|
||||
ha_message_t *message;
|
||||
char buf[1024];
|
||||
int oldstate;
|
||||
bool oldstate;
|
||||
ssize_t len;
|
||||
|
||||
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &oldstate);
|
||||
oldstate = thread_cancelability(TRUE);
|
||||
len = recv(this->fd, buf, sizeof(buf), 0);
|
||||
pthread_setcancelstate(oldstate, NULL);
|
||||
thread_cancelability(oldstate);
|
||||
if (len <= 0)
|
||||
{
|
||||
switch (errno)
|
||||
|
||||
Reference in New Issue
Block a user