diff options
author | Max Kellermann <max@duempel.org> | 2013-01-27 17:20:50 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-01-27 18:39:32 +0100 |
commit | 6f3d70b5e24cebbd6fd8c3a665a801628ef912ff (patch) | |
tree | 88ab67b76bac4b88422c3debe7c46d6168a71934 /test/read_tags.cxx | |
parent | 257a0dee758049586efbf0dc3f0339b0cef03456 (diff) |
DecoderControl, InputStream: use Mutex/Cond instead of GMutex/GCond
Diffstat (limited to 'test/read_tags.cxx')
-rw-r--r-- | test/read_tags.cxx | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/test/read_tags.cxx b/test/read_tags.cxx index a634d72b..ddd278ff 100644 --- a/test/read_tags.cxx +++ b/test/read_tags.cxx @@ -186,8 +186,8 @@ int main(int argc, char **argv) bool success = decoder_plugin_scan_file(plugin, path, &print_handler, NULL); if (!success && plugin->scan_stream != NULL) { - GMutex *mutex = g_mutex_new(); - GCond *cond = g_cond_new(); + Mutex mutex; + Cond cond; struct input_stream *is = input_stream_open(path, mutex, cond, &error); @@ -199,15 +199,15 @@ int main(int argc, char **argv) return 1; } - g_mutex_lock(mutex); + mutex.lock(); while (!is->ready) { - g_cond_wait(cond, mutex); + cond.wait(mutex); input_stream_update(is); } if (!input_stream_check(is, &error)) { - g_mutex_unlock(mutex); + mutex.unlock(); g_printerr("Failed to read %s: %s\n", path, error->message); @@ -216,14 +216,11 @@ int main(int argc, char **argv) return EXIT_FAILURE; } - g_mutex_unlock(mutex); + mutex.unlock(); success = decoder_plugin_scan_stream(plugin, is, &print_handler, NULL); input_stream_close(is); - - g_cond_free(cond); - g_mutex_free(mutex); } decoder_plugin_deinit_all(); |