1 /* Copyright (c) 2019. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
6 #include "src/kernel/activity/SemaphoreImpl.hpp"
8 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_semaphore, simix_synchro, "Semaphore kernel-space implementation");
14 void SemaphoreImpl::release()
16 XBT_DEBUG("Sem release semaphore %p", this);
18 if (not sleeping_.empty()) {
19 auto& actor = sleeping_.front();
20 sleeping_.pop_front();
21 actor.waiting_synchro = nullptr;
22 SIMIX_simcall_answer(&actor.simcall);
28 } // namespace activity
30 } // namespace simgrid