Skip to content

Commit

Permalink
unnamed_semaphore implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
gammasoft71 committed Dec 7, 2023
1 parent fcdd51e commit 907a00e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using namespace xtd::native;

intmax_t unnamed_semaphore::create(int_least32_t initial_count, int_least32_t max_count) {
sem_t* semaphore = new sem_t;
auto semaphore = new sem_t;
if (sem_init(semaphore, 0, std::min(initial_count, max_count)) == -1) return reinterpret_cast<intmax_t>(SEM_FAILED);
return reinterpret_cast<intmax_t>(semaphore);
}
Expand Down

0 comments on commit 907a00e

Please sign in to comment.