54 static pthread_mutex_t
mutex = PTHREAD_MUTEX_INITIALIZER;
55 static pthread_cond_t
cond = PTHREAD_COND_INITIALIZER;
81 pthread_mutex_lock (&
mutex);
83 GQueue queue = G_QUEUE_INIT;
88 g_hash_table_iter_init (& iter,
art_items);
89 while (g_hash_table_iter_next (& iter, & ptr1, & ptr2))
96 g_queue_push_tail (& queue,
str_ref (file));
107 pthread_mutex_unlock (&
mutex);
109 char * current =
NULL;
114 while ((file = g_queue_pop_head (& queue)))
118 if (current && ! strcmp (file, current))
136 pthread_mutex_lock (&
mutex);
140 assert (item !=
NULL && ! item->
flag);
149 pthread_cond_broadcast (&
cond);
150 pthread_mutex_unlock (&
mutex);
157 if (item && item->
flag)
201 art_items = g_hash_table_new_full (g_str_hash, g_str_equal,
231 pthread_mutex_lock (&
mutex);
250 pthread_mutex_unlock (&
mutex);
255 const char * art_file =
NULL;
256 pthread_mutex_lock (&
mutex);
280 pthread_mutex_unlock (&
mutex);
294 void art_get_data (
const char * file,
const void * * data, int64_t * len)
296 fprintf (stderr,
"aud_art_get_data() is deprecated. Use "
297 "aud_art_request_data() instead.\n");
303 fprintf (stderr,
"aud_art_get_file() is deprecated. Use "
304 "aud_art_request_file() instead.\n");
310 pthread_mutex_lock (&
mutex);
313 assert (item !=
NULL);
317 pthread_mutex_unlock (&
mutex);