Refactor the work queue

Make a separate work queue to track async operations. Keep separate
work queues for links and nodes. This avoids lockups when some async
operation take a long time and the work queue has SYNC_WAIT operations.
This commit is contained in:
Wim Taymans 2017-01-12 16:48:17 +01:00
parent 6d4db64767
commit 474981ddda
9 changed files with 344 additions and 238 deletions

View file

@ -80,19 +80,6 @@ typedef struct {
PinosConnection *connection;
} PinosProtocolNativeClient;
static void
sync_destroy (void *object,
void *data,
SpaResult res,
uint32_t id)
{
PinosProtocolNativeClient *this = object;
pinos_connection_destroy (this->connection);
close (this->fd);
free (this);
}
static void
client_destroy (PinosProtocolNativeClient *this)
{
@ -101,11 +88,9 @@ client_destroy (PinosProtocolNativeClient *this)
pinos_client_destroy (this->client);
spa_list_remove (&this->link);
pinos_main_loop_defer (this->impl->core->main_loop,
this,
SPA_RESULT_WAIT_SYNC,
sync_destroy,
this);
pinos_connection_destroy (this->connection);
close (this->fd);
free (this);
}
static SpaResult