From c708ca4491adadd3994b625e1bb4b528eb15cd7c Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 28 Jan 2016 08:53:35 +0100 Subject: Added debug --- src/audiocacheeventhandler.cc | 8 ++++++++ src/mutex.cc | 4 ++++ 2 files changed, 12 insertions(+) (limited to 'src') diff --git a/src/audiocacheeventhandler.cc b/src/audiocacheeventhandler.cc index 01db796..ccaf665 100644 --- a/src/audiocacheeventhandler.cc +++ b/src/audiocacheeventhandler.cc @@ -165,6 +165,8 @@ void AudioCacheEventHandler::pushCloseEvent(cacheid_t id) void AudioCacheEventHandler::setChunkSize(size_t chunksize) { + DEBUG(cache, "%s\n", __PRETTY_FUNCTION__); + // We should already locked when this method is called. assert(!mutex.try_lock()); @@ -173,12 +175,18 @@ void AudioCacheEventHandler::setChunkSize(size_t chunksize) return; } + DEBUG(cache, "1)\n"); + // Remove all events from event queue. clearEvents(); + DEBUG(cache, "2)\n"); + // Skip all active cacheids and make their buffers point at nodata. idManager.disableActive(); + DEBUG(cache, "3)\n"); + this->chunksize = chunksize; } diff --git a/src/mutex.cc b/src/mutex.cc index e01bc95..75d569d 100644 --- a/src/mutex.cc +++ b/src/mutex.cc @@ -71,6 +71,10 @@ Mutex::~Mutex() bool Mutex::try_lock() { #ifdef WIN32 + DEBUG(mutex, "%s\n", __PRETTY_FUNCTION__); + DEBUG(mutex, "WAIT_OBJECT_0: %d, WaitForSingleObject: %d\n", + WAIT_OBJECT_0, WaitForSingleObject(prv->mutex, 0)); + return WaitForSingleObject(prv->mutex, 0) == WAIT_OBJECT_0; #else return pthread_mutex_trylock(&prv->mutex) != EBUSY; -- cgit v1.2.3