-// This example implements a one-time use barrier with 1 semaphore and 1 mutex.
-
-static void worker(simgrid::s4u::SemaphorePtr semaphore, simgrid::s4u::MutexPtr mutex, int process_count, std::shared_ptr<int> count)
-{
- mutex->lock();
- XBT_INFO("Got mutex. Incrementing count.");
- XBT_INFO("Count is %d", *count);
- *count = (*count) + 1;
- XBT_INFO("Count is now %d. Process count is %d.", *count, process_count);
+const char* buffer; /* Where the data is exchanged */
+simgrid::s4u::SemaphorePtr sem_empty = simgrid::s4u::Semaphore::create(1); /* indicates whether the buffer is empty */
+simgrid::s4u::SemaphorePtr sem_full = simgrid::s4u::Semaphore::create(0); /* indicates whether the buffer is full */