kopia lustrzana https://github.com/Hamlib/Hamlib
Wrap pthread calls in #ifdef HAVE_PTHREAD in rig.c
rodzic
b65fdb61f8
commit
ff9a745c7a
|
@ -61,7 +61,9 @@
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#ifdef HAVE_PTHREAD
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#include <hamlib/rig.h>
|
#include <hamlib/rig.h>
|
||||||
|
@ -1108,6 +1110,7 @@ int HAMLIB_API rig_close(RIG *rig)
|
||||||
// terminate the multicast server
|
// terminate the multicast server
|
||||||
extern int multicast_server_run;
|
extern int multicast_server_run;
|
||||||
multicast_server_run = 0;
|
multicast_server_run = 0;
|
||||||
|
#ifdef HAVE_PTHREAD
|
||||||
extern pthread_t multicast_server_threadId;
|
extern pthread_t multicast_server_threadId;
|
||||||
|
|
||||||
if (multicast_server_threadId != 0)
|
if (multicast_server_threadId != 0)
|
||||||
|
@ -1123,6 +1126,7 @@ int HAMLIB_API rig_close(RIG *rig)
|
||||||
|
|
||||||
multicast_server_threadId = 0;
|
multicast_server_threadId = 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!rig || !rig->caps)
|
if (!rig || !rig->caps)
|
||||||
{
|
{
|
||||||
|
@ -6551,7 +6555,9 @@ int HAMLIB_API rig_cookie(RIG *rig, enum cookie_e cookie_cmd, char *cookie,
|
||||||
static double time_last_used;
|
static double time_last_used;
|
||||||
double time_curr;
|
double time_curr;
|
||||||
struct timespec tp;
|
struct timespec tp;
|
||||||
|
#ifdef HAVE_PTHREAD
|
||||||
static pthread_mutex_t cookie_lock = PTHREAD_MUTEX_INITIALIZER;
|
static pthread_mutex_t cookie_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (cookie_len < 27)
|
if (cookie_len < 27)
|
||||||
{
|
{
|
||||||
|
|
Ładowanie…
Reference in New Issue