Commit 2a15fafb authored by Max Kellermann's avatar Max Kellermann

input/smbclient: remove mutex locking

This is no longer necessary with the new API.
parent 2fc48028
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include "SmbclientInputPlugin.hxx" #include "SmbclientInputPlugin.hxx"
#include "lib/smbclient/Init.hxx" #include "lib/smbclient/Init.hxx"
#include "lib/smbclient/Context.hxx" #include "lib/smbclient/Context.hxx"
#include "lib/smbclient/Mutex.hxx"
#include "../InputStream.hxx" #include "../InputStream.hxx"
#include "../InputPlugin.hxx" #include "../InputPlugin.hxx"
#include "../MaybeBufferedInputStream.hxx" #include "../MaybeBufferedInputStream.hxx"
...@@ -47,7 +46,6 @@ public: ...@@ -47,7 +46,6 @@ public:
} }
~SmbclientInputStream() override { ~SmbclientInputStream() override {
const std::lock_guard<Mutex> lock(smbclient_mutex);
ctx.Close(handle); ctx.Close(handle);
} }
...@@ -87,8 +85,6 @@ input_smbclient_open(const char *uri, ...@@ -87,8 +85,6 @@ input_smbclient_open(const char *uri,
{ {
auto ctx = SmbclientContext::New(); auto ctx = SmbclientContext::New();
const std::lock_guard<Mutex> protect(smbclient_mutex);
SMBCFILE *handle = ctx.OpenReadOnly(uri); SMBCFILE *handle = ctx.OpenReadOnly(uri);
if (handle == nullptr) if (handle == nullptr)
throw MakeErrno("smbc_open() failed"); throw MakeErrno("smbc_open() failed");
...@@ -111,7 +107,6 @@ SmbclientInputStream::Read(std::unique_lock<Mutex> &, ...@@ -111,7 +107,6 @@ SmbclientInputStream::Read(std::unique_lock<Mutex> &,
{ {
const ScopeUnlock unlock(mutex); const ScopeUnlock unlock(mutex);
const std::lock_guard<Mutex> lock(smbclient_mutex);
nbytes = ctx.Read(handle, ptr, read_size); nbytes = ctx.Read(handle, ptr, read_size);
} }
...@@ -130,7 +125,6 @@ SmbclientInputStream::Seek(std::unique_lock<Mutex> &, ...@@ -130,7 +125,6 @@ SmbclientInputStream::Seek(std::unique_lock<Mutex> &,
{ {
const ScopeUnlock unlock(mutex); const ScopeUnlock unlock(mutex);
const std::lock_guard<Mutex> lock(smbclient_mutex);
result = ctx.Seek(handle, new_offset); result = ctx.Seek(handle, new_offset);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment