mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-12-22 08:48: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:
|
public:
|
||||||
explicit Semaphore(int value) { sem_init(&mutex, 0, value); }
|
explicit Semaphore(int value) { sem_init(&mutex, 0, value); }
|
||||||
~Semaphore() { sem_destroy(&mutex); }
|
~Semaphore() { sem_destroy(&mutex); }
|
||||||
|
Semaphore(const Semaphore&) = delete;
|
||||||
|
Semaphore(Semaphore&&) = delete;
|
||||||
|
Semaphore& operator=(const Semaphore&) = delete;
|
||||||
|
Semaphore& operator=(Semaphore&&) = delete;
|
||||||
|
|
||||||
void acquire()
|
void acquire()
|
||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
@ -86,6 +91,7 @@ class Semaphore
|
|||||||
r = sem_wait(&mutex);
|
r = sem_wait(&mutex);
|
||||||
} while (r == -1 && errno == EINTR);
|
} while (r == -1 && errno == EINTR);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool try_acquire()
|
bool try_acquire()
|
||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
@ -95,6 +101,7 @@ class Semaphore
|
|||||||
|
|
||||||
return (0 == result);
|
return (0 == result);
|
||||||
}
|
}
|
||||||
|
|
||||||
void release() { sem_post(&mutex); }
|
void release() { sem_post(&mutex); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
Reference in New Issue
Block a user