kopia lustrzana https://github.com/Hamlib/Hamlib
Remove rig_lock/unlock as not needed for eventual async i/o implementation
rodzic
ada6543b09
commit
71662c79f8
|
@ -3181,10 +3181,6 @@ extern HAMLIB_EXPORT(int) hl_usleep(rig_useconds_t msec);
|
||||||
|
|
||||||
extern HAMLIB_EXPORT(int) rig_cookie(RIG *rig, enum cookie_e cookie_cmd, char *cookie, int cookie_len);
|
extern HAMLIB_EXPORT(int) rig_cookie(RIG *rig, enum cookie_e cookie_cmd, char *cookie, int cookie_len);
|
||||||
|
|
||||||
// two functions globally accessible so rig backends can lock for an I/O transaction
|
|
||||||
void rig_lock();
|
|
||||||
void rig_unlock();
|
|
||||||
|
|
||||||
//! @endcond
|
//! @endcond
|
||||||
|
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
|
25
src/rig.c
25
src/rig.c
|
@ -202,31 +202,6 @@ static const char *const rigerror_table[] =
|
||||||
|
|
||||||
#define ERROR_TBL_SZ (sizeof(rigerror_table)/sizeof(char *))
|
#define ERROR_TBL_SZ (sizeof(rigerror_table)/sizeof(char *))
|
||||||
|
|
||||||
#ifdef HAVE_PTHREAD
|
|
||||||
// Any call to rig_set or rig_get functions will lock the rig
|
|
||||||
// for non-targetable rigs this will still be problematic for rigctld
|
|
||||||
// in non-vfo mode as a transaction may be set_vfo/set_x/set_vfo
|
|
||||||
// this would require the client to request a lock
|
|
||||||
static pthread_mutex_t rig_lock_mutex = PTHREAD_MUTEX_INITIALIZER;
|
|
||||||
void rig_lock()
|
|
||||||
{
|
|
||||||
#ifdef HAVE_PTHREAD
|
|
||||||
pthread_mutex_lock(&rig_lock_mutex);
|
|
||||||
rig_debug(RIG_DEBUG_TRACE, "%s\n", __func__);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
void rig_unlock()
|
|
||||||
{
|
|
||||||
#ifdef HAVE_PTHREAD
|
|
||||||
pthread_mutex_unlock(&rig_lock_mutex);
|
|
||||||
rig_debug(RIG_DEBUG_TRACE, "%s\n", __func__);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
void rig_lock() {};
|
|
||||||
void rig_unlock() {};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* track which rig is opened (with rig_open)
|
* track which rig is opened (with rig_open)
|
||||||
* needed at least for transceive mode
|
* needed at least for transceive mode
|
||||||
|
|
Ładowanie…
Reference in New Issue