mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-12-22 00:38:55 +00:00
Delete Semaphore copy and move methods (#2613)
This matches the macOS implementation.
This commit is contained in:
parent
990d2e0074
commit
d13396127c
@ -79,6 +79,11 @@ class Semaphore
|
||||
public:
|
||||
explicit Semaphore(int value) { sem_init(&mutex, 0, value); }
|
||||
~Semaphore() { sem_destroy(&mutex); }
|
||||
Semaphore(const Semaphore&) = delete;
|
||||
Semaphore(Semaphore&&) = delete;
|
||||
Semaphore& operator=(const Semaphore&) = delete;
|
||||
Semaphore& operator=(Semaphore&&) = delete;
|
||||
|
||||
void acquire()
|
||||
{
|
||||
int r;
|
||||
@ -86,6 +91,7 @@ class Semaphore
|
||||
r = sem_wait(&mutex);
|
||||
} while (r == -1 && errno == EINTR);
|
||||
}
|
||||
|
||||
bool try_acquire()
|
||||
{
|
||||
int result;
|
||||
@ -95,6 +101,7 @@ class Semaphore
|
||||
|
||||
return (0 == result);
|
||||
}
|
||||
|
||||
void release() { sem_post(&mutex); }
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user