TOOLS += vscclient$(EXESUF)
# objects linked into a shared library, built with libtool with -fPIC if required
-libcacard-obj-y = $(stub-obj-y) $(libcacard-y)
-libcacard-obj-y += util/osdep.o util/cutils.o util/qemu-timer-common.o
-libcacard-obj-y += util/error.o util/qemu-error.o
-libcacard-obj-$(CONFIG_WIN32) += util/oslib-win32.o util/qemu-thread-win32.o
-libcacard-obj-$(CONFIG_POSIX) += util/oslib-posix.o util/qemu-thread-posix.o
-libcacard-obj-y += $(filter trace/%, $(util-obj-y))
-
+libcacard-obj-y = $(libcacard-y)
libcacard-lobj-y=$(patsubst %.o,%.lo,$(libcacard-obj-y))
# libtool will build the .o files, too
*/
#include "qemu-common.h"
-#include "qemu/thread.h"
#include "vcard.h"
#include "vreader.h"
static VEvent *vevent_queue_head;
static VEvent *vevent_queue_tail;
-static QemuMutex vevent_queue_lock;
-static QemuCond vevent_queue_condition;
+static CompatGMutex vevent_queue_lock;
+static CompatGCond vevent_queue_condition;
void vevent_queue_init(void)
{
- qemu_mutex_init(&vevent_queue_lock);
- qemu_cond_init(&vevent_queue_condition);
vevent_queue_head = vevent_queue_tail = NULL;
}
vevent_queue_vevent(VEvent *vevent)
{
vevent->next = NULL;
- qemu_mutex_lock(&vevent_queue_lock);
+ g_mutex_lock(&vevent_queue_lock);
if (vevent_queue_head) {
assert(vevent_queue_tail);
vevent_queue_tail->next = vevent;
vevent_queue_head = vevent;
}
vevent_queue_tail = vevent;
- qemu_cond_signal(&vevent_queue_condition);
- qemu_mutex_unlock(&vevent_queue_lock);
+ g_cond_signal(&vevent_queue_condition);
+ g_mutex_unlock(&vevent_queue_lock);
}
/* must have lock */
{
VEvent *vevent;
- qemu_mutex_lock(&vevent_queue_lock);
+ g_mutex_lock(&vevent_queue_lock);
while ((vevent = vevent_dequeue_vevent()) == NULL) {
- qemu_cond_wait(&vevent_queue_condition, &vevent_queue_lock);
+ g_cond_wait(&vevent_queue_condition, &vevent_queue_lock);
}
- qemu_mutex_unlock(&vevent_queue_lock);
+ g_mutex_unlock(&vevent_queue_lock);
return vevent;
}
{
VEvent *vevent;
- qemu_mutex_lock(&vevent_queue_lock);
+ g_mutex_lock(&vevent_queue_lock);
vevent = vevent_dequeue_vevent();
- qemu_mutex_unlock(&vevent_queue_lock);
+ g_mutex_unlock(&vevent_queue_lock);
return vevent;
}
#undef G_LOG_DOMAIN
#endif
#define G_LOG_DOMAIN "libcacard"
-#include <glib.h>
#include "qemu-common.h"
-#include "qemu/thread.h"
#include "vcard.h"
#include "vcard_emul.h"
VCard *card;
char *name;
vreader_id_t id;
- QemuMutex lock;
+ CompatGMutex lock;
VReaderEmul *reader_private;
VReaderEmulFree reader_private_free;
};
static inline void
vreader_lock(VReader *reader)
{
- qemu_mutex_lock(&reader->lock);
+ g_mutex_lock(&reader->lock);
}
static inline void
vreader_unlock(VReader *reader)
{
- qemu_mutex_unlock(&reader->lock);
+ g_mutex_unlock(&reader->lock);
}
/*
VReader *reader;
reader = g_new(VReader, 1);
- qemu_mutex_init(&reader->lock);
+ g_mutex_init(&reader->lock);
reader->reference_count = 1;
reader->name = g_strdup(name);
reader->card = NULL;
return;
}
vreader_unlock(reader);
+ g_mutex_clear(&reader->lock);
if (reader->card) {
vcard_free(reader->card);
}
}
static VReaderList *vreader_list;
-static QemuMutex vreader_list_mutex;
+static CompatGMutex vreader_list_mutex;
static void
vreader_list_init(void)
{
vreader_list = vreader_list_new();
- qemu_mutex_init(&vreader_list_mutex);
}
static void
vreader_list_lock(void)
{
- qemu_mutex_lock(&vreader_list_mutex);
+ g_mutex_lock(&vreader_list_mutex);
}
static void
vreader_list_unlock(void)
{
- qemu_mutex_unlock(&vreader_list_mutex);
+ g_mutex_unlock(&vreader_list_mutex);
}
static VReaderList *