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;
89 for (g_hash_table_iter_init (& iter,
art_items);
90 g_hash_table_iter_next (& iter, (
void * *) & file, (
void * *) & item);)
94 g_queue_push_tail (& queue,
str_ref (file));
105 pthread_mutex_unlock (&
mutex);
107 char * current =
NULL;
111 while ((file = g_queue_pop_head (& queue)))
115 if (current && ! strcmp (file, current))
133 pthread_mutex_lock (&
mutex);
137 assert (item !=
NULL && ! item->
flag);
146 pthread_cond_broadcast (&
cond);
147 pthread_mutex_unlock (&
mutex);
154 if (item && item->
flag)
198 art_items = g_hash_table_new_full (g_str_hash, g_str_equal,
228 pthread_mutex_lock (&
mutex);
247 pthread_mutex_unlock (&
mutex);
252 const char * art_file =
NULL;
253 pthread_mutex_lock (&
mutex);
277 pthread_mutex_unlock (&
mutex);
291 void art_get_data (
const char * file,
const void * * data, int64_t * len)
293 fprintf (stderr,
"aud_art_get_data() is deprecated. Use "
294 "aud_art_request_data() instead.\n");
300 fprintf (stderr,
"aud_art_get_file() is deprecated. Use "
301 "aud_art_request_file() instead.\n");
307 pthread_mutex_lock (&
mutex);
310 assert (item !=
NULL);
314 pthread_mutex_unlock (&
mutex);