Skip to content

Commit

Permalink
booru/imagefetcher: Recursive mutex is not needed here
Browse files Browse the repository at this point in the history
  • Loading branch information
ahodesuka committed Nov 23, 2017
1 parent cbb7e48 commit 2ab9156
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/booru/imagefetcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ int ImageFetcher::timer_cb(CURLM*, long timeout_ms, void *userp)
{
ImageFetcher *self = static_cast<ImageFetcher*>(userp);

std::lock_guard<std::recursive_mutex> lock(self->m_Mutex);
self->m_TimeoutConn = self->m_MainContext->signal_timeout().connect(
sigc::mem_fun(self, &ImageFetcher::timeout_cb), timeout_ms);

Expand Down Expand Up @@ -74,7 +73,7 @@ ImageFetcher::~ImageFetcher()

void ImageFetcher::add_handle(Curler *curler)
{
std::lock_guard<std::recursive_mutex> lock(m_Mutex);
std::lock_guard<std::mutex> lock(m_Mutex);

curl_easy_setopt(curler->m_EasyHandle, CURLOPT_PRIVATE, curler);

Expand Down
2 changes: 1 addition & 1 deletion src/booru/imagefetcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace AhoViewer
Glib::RefPtr<Glib::MainContext> m_MainContext;
Glib::RefPtr<Glib::MainLoop> m_MainLoop;
std::thread m_Thread;
std::recursive_mutex m_Mutex;
std::mutex m_Mutex;

CURLM *m_MultiHandle;
int m_RunningHandles;
Expand Down

0 comments on commit 2ab9156

Please sign in to comment.